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 0000000000..6eba080dd6 Binary files /dev/null and b/services/web/frontend/fonts/material-symbols/MaterialSymbolsRoundedUnfilledPartialSlice.woff2 differ 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 (