- Issue created by @omarlopesino
- πͺπΈSpain omarlopesino
Working on a first version that allow replacing global variables. They appear inside a fieldset, and for each one there is a textfield.
Preview:
Pending:
- Coding style
- Use custom textarea to allow creating new variables.
- Consider validate if new variables are not the same than overriden variables.
- πͺπΈSpain omarlopesino
Coding style --> fixed
Use custom textarea to allow creating new variables -> Done
Consider validate if new variables are not the same than overriden variables -> I have added a validation to check new css variables have correct format, plus they do not conflict with the variables of the current selector. @omarlopesino would it be possible to have a way of "classify" CSS vars?
Artisan already ships with ~50 vars, and probably themes extending Artisan will add more, making it difficult for site builders to change the value of a specific variable.
Im thinking about doing it with CSS comments, since customizer reads the src/main.css.
/* @customizer Typography */ --theme-font-family: var(--font-sans); --theme-font-family-secondary: var(--font-serif); --theme-font-size: var(--text-base); --theme-font-size-sm: calc(var(--theme-font-size) * .8); --theme-font-size-lg:calc(var(--theme-font-size) * 1.125); --theme-h1-font-size: calc(var(--theme-font-size) * 3); --theme-h2-font-size: calc(var(--theme-font-size) * 2.5); --theme-h3-font-size: calc(var(--theme-font-size) * 2); --theme-h4-font-size: calc(var(--theme-font-size) * 1.5); --theme-h5-font-size: calc(var(--theme-font-size) * 1.25); --theme-h6-font-size: calc(var(--theme-font-size)); --theme-line-height-sm: var(--text-3xl--line-height); --theme-line-height: var(--text-base--line-height); --theme-line-height-lg: 1.8; ... /* @customizer-end Typography */ /* @customizer Colors */ --theme-primary: var(--color-primary); --theme-primary-content: var(--color-primary-content); --theme-secondary: var(--color-secondary); --theme-secondary-content: var(--color-secondary-content); ... /* @customizer-end Colors */
where Typography and Colors might be inner Details, collapsed by default.
- πΊπΈUnited States mortona2k Seattle
Any interest in integrating with UI Styles?
-
omarlopesino β
committed 7a3b2111 on 2.x
Resolve #3533358 "Refactor customizer as"
-
omarlopesino β
committed 7a3b2111 on 2.x
- πͺπΈSpain omarlopesino
Integrating with UI styles currently is not in our scope, but it could be good to considerate as UI styles integrates at entity bundle level and it is more abstracted from CSS variables.
Having said this, the MR has been reviewed so it has been merged.