-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathModdableIconStyle.ts
More file actions
25 lines (21 loc) · 957 Bytes
/
ModdableIconStyle.ts
File metadata and controls
25 lines (21 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { type StyleSet } from '../Styles/StyleSet/types/StyleSet';
export default function createModdableIconStyle() {
return {
'&.webchat__moddable-icon': {
height: 'var(--webchat__moddable-icon--size, 1em)',
width: 'var(--webchat__moddable-icon--size, 1em)',
// 1. Use the image as texture.
backgroundImage: 'var(--webchat__moddable-icon--image, none)',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
backgroundSize: 'var(--webchat__moddable-icon--size, 1em)',
// 2. If image is not set, fallback to solid color.
backgroundColor: 'var(--webchat__moddable-icon--color, transparent)',
// 3. Set the mask if any.
maskImage: 'var(--webchat__moddable-icon--mask)', // TODO: Need to think about 3P customization story.
maskPosition: 'center',
maskRepeat: 'no-repeat',
maskSize: 'var(--webchat__moddable-icon--size, 1em)'
}
} satisfies StyleSet;
}