Compare commits
4 Commits
next
...
ionic-colo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36dfc50fa3 | ||
|
|
1ded2c5191 | ||
|
|
c8679f8b1b | ||
|
|
6f089c0536 |
@@ -122,8 +122,8 @@ function generateTypographyUtilityClass(prop, dictionary) {
|
||||
|
||||
// Generates a color based css utility-class from a color Design Token structure
|
||||
function generateColorUtilityClasses(prop, className) {
|
||||
return `.${variablesPrefix}-${className} {\n color: $ionic-${prop.name};\n}
|
||||
.${variablesPrefix}-background-${className} {\n background-color: $ionic-${prop.name};\n}`;
|
||||
return `.${variablesPrefix}-${className} {\n --color: $ionic-${prop.name};\n}
|
||||
.${variablesPrefix}-background-${className} {\n --background: $ionic-${prop.name};\n}`;
|
||||
}
|
||||
|
||||
// Generates a font based css utility-class from a font Design Token structure
|
||||
|
||||
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -6,15 +6,20 @@ export const hostContext = (selector: string, el: HTMLElement): boolean => {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create the mode and color classes for the component based on the classes passed in
|
||||
* Create the mode and color classes for the component based on the classes passed in and the theme being used
|
||||
*/
|
||||
export const createColorClasses = (color: Color | undefined | null, cssClassMap: CssClassMap): CssClassMap => {
|
||||
return typeof color === 'string' && color.length > 0
|
||||
? {
|
||||
'ion-color': true,
|
||||
[`ion-color-${color}`]: true,
|
||||
...cssClassMap,
|
||||
}
|
||||
? cssClassMap.ionic === true
|
||||
? {
|
||||
[`ionic-background-color-${color}`]: true,
|
||||
...cssClassMap,
|
||||
}
|
||||
: {
|
||||
'ion-color': true,
|
||||
[`ion-color-${color}`]: true,
|
||||
...cssClassMap,
|
||||
}
|
||||
: cssClassMap;
|
||||
};
|
||||
|
||||
|
||||