From 7c5a63153b40f39cfb07547848656c57a9a9cb2d Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Thu, 16 Jan 2025 10:00:06 +0000 Subject: [PATCH] Merge pull request #22802 from overleaf/mj-outline-icons [web] Add some unfilled material symbols GitOrigin-RevId: 2b5c477e6ff32f62ab40cacf666aeb98b311f126 --- ...alSymbolsRoundedUnfilledPartialSlice.woff2 | Bin 0 -> 2336 bytes .../material-symbols/material-symbols.css | 22 +++++++++++++++ .../js/shared/components/material-icon.tsx | 26 ++++++++++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 services/web/frontend/fonts/material-symbols/MaterialSymbolsRoundedUnfilledPartialSlice.woff2 diff --git a/services/web/frontend/fonts/material-symbols/MaterialSymbolsRoundedUnfilledPartialSlice.woff2 b/services/web/frontend/fonts/material-symbols/MaterialSymbolsRoundedUnfilledPartialSlice.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..6eba080dd6f7f346348e385410b131ee6b8cbf63 GIT binary patch literal 2336 zcmV+*3E%d2Pew8T0RR9100|%f4gdfE01%7-00_na0RR9100000000000000000000 z0000Sf&vC$KT}jeRAK;u91#c#lNgUp3p4-$HUcCAGz1_8g$@TG3NT!jp zaQ=S&|L4^16Bzy%*iQJgE-{%Bc2XdaIxNj_z)(V^v;rOm*@L)i7n?aYpf0Nh0o2=} zX4ipwlny(dke%5Gn5B9_zi<#%8d`I8Vs(*d(?+O-NNAL{-QV;Jd?0LufYD$OPz;Zp>;Xd%0fgcuaClKHW#v%JPzn_cWtu?&<xw6<_kba zIaKHR1_%M*KDlr)L;xcp z%$~P!;XeDEvwYf2BG8ttJNADCpFJlVp zt(0n-ru(^H8tN-$r4sk*o~D}Wb#fx1R#T0##_k}~Vb&!Wm*aK^%?WvY!n#lzYs=6p zXUpR47df}jmqc6BfRQSWw47rx9;XmkYJBhIs5aQm|gZa;uz+-IA0(MxOm`19n>4I^e)sv#Nm1>$KGRtWq7zWV*31$hhXAQU8=|)*HGo_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*B zT>kj<<8#41sIB99g3Gv#NzS~C900aZuuvR|0OW&(cww4oLs$)| zRS(;u28~dQI&yfUGZqhPcnpgVeICUUK!M*`LPTNgEss? zREsQuC4eq;do4YEg>(jZ6{=>o=niQdA=s z1t^3Br9IvXL?aiqwrZ3fmY;wou*idw7T17*5_PCNI9LD?{4g!vV8Bw0IuXo8HIj8@ zHS({Os00ZSe6R|B@JAj*%0Z-5k#Z`s2JgEMfE2Nag%kmSH(2OWu*nfnVlA4q;2nUQ z<3(5o5>n|`q8JrqGZImVLIiw3f<%}Em|`91z*dNw5b*i}_lePK>c&rM;%VN;zQe*X G0001vc~$@b literal 0 HcmV?d00001 diff --git a/services/web/frontend/fonts/material-symbols/material-symbols.css b/services/web/frontend/fonts/material-symbols/material-symbols.css index a6a8e093a9..7fda97b6ef 100644 --- a/services/web/frontend/fonts/material-symbols/material-symbols.css +++ b/services/web/frontend/fonts/material-symbols/material-symbols.css @@ -10,6 +10,19 @@ src: url('MaterialSymbolsRoundedSlice.woff2') format('woff2'); } +@font-face { + font-family: 'Material Symbols Rounded Unfilled Partial'; + font-style: normal; + font-weight: 400; + font-display: block; + /* + Generated by accessing + https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20,400,0,0&icon_names=SORTED_SYMBOL_LIST&display=block + with a sorted list of symbols, and downloading the linked woff2 file. + */ + src: url('MaterialSymbolsRoundedUnfilledPartialSlice.woff2') format('woff2'); +} + .material-symbols { font-family: 'Material Symbols Rounded'; font-weight: normal; @@ -37,4 +50,13 @@ &.rotate-180 { transform: rotate(180deg); } + + &.unfilled { + font-family: 'Material Symbols Rounded Unfilled Partial'; + font-variation-settings: + 'FILL' 0, + 'wght' 400, + 'GRAD' 0, + 'opsz' 20; + } } diff --git a/services/web/frontend/js/shared/components/material-icon.tsx b/services/web/frontend/js/shared/components/material-icon.tsx index 6ef71a1d4b..19305b7e60 100644 --- a/services/web/frontend/js/shared/components/material-icon.tsx +++ b/services/web/frontend/js/shared/components/material-icon.tsx @@ -2,23 +2,45 @@ import classNames from 'classnames' import React from 'react' import { bsVersion } from '@/features/utils/bootstrap-5' -type IconProps = React.ComponentProps<'i'> & { - type: string +// NOTE: When updating this list, make sure to update the bundled .woff2 +// file as well. See details in material-symbols.css +export type AvailableUnfilledIcon = + | 'description' + | 'forum' + | 'integration_instructions' + | 'rate_review' + | 'report' + +type BaseIconProps = React.ComponentProps<'i'> & { accessibilityLabel?: string modifier?: string size?: '2x' } +type FilledIconProps = BaseIconProps & { + type: string + unfilled?: false +} + +type UnfilledIconProps = BaseIconProps & { + type: AvailableUnfilledIcon + unfilled: true +} + +type IconProps = FilledIconProps | UnfilledIconProps + function MaterialIcon({ type, className, accessibilityLabel, modifier, size, + unfilled, ...rest }: IconProps) { const iconClassName = classNames('material-symbols', className, modifier, { [`size-${size}`]: size, + unfilled, }) return (