Color Variables -- to rgb() or not to rgb() #186
Replies: 1 comment 2 replies
-
|
These base colors are utilized on many different locations in more variables: LiaScript/src/scss/03_elements/_elements.page.scss Lines 1 to 22 in 14e97b3 to which later also alpha values are attached ... LiaScript/src/scss/03_elements/_elements.code.scss Lines 45 to 62 in 14e97b3 Unfortunately, using only gold will break the scss ... The former UI/SCSS developer said, that this is the shortest and optimal way to utilize variables and change them dynamically ... In general, there are 9 base variables that you can use to customize your course, but we did not add this to the documentation, since we did not like how the configuration was done and still seek for another way: <!--
@custom
--color-highlight: 2,255,0;
--color-background: 122,122,122;
--color-border: 0,0,0;
--color-highlight-dark: 0,0,0;
--color-highlight-menu: 0,0,0;
--color-text: 0,0,255;
--global-font-size: 1rem;
--font-size-multiplier: 2;
@end
-->
# Main Titleall variables are: --color-background
--color-border
--color-highlight-dark
--color-highlight-menu
--color-highlight
--color-text
--global-font-family
--global-font-mono
--global-font-headline
--global-font-size
--font-size-multiplier
--max-editor-line-count |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
All the color variables in liascript are defined as strings and not as css colors. See _settings.colors.scss
Whenever they are used, the
rgb()-function is used to convert them.Is there any specific reason for this? It caused me to stumble a bit when trying to customize the design.
It has the disadvantage that it is inconvenient to overwrite lia-script's css color variables like
--color-highlightSo a very common idiom like
is not possible.
I would have to look up the rgb value of
goldand paste it in.This also leads to diminished interoperability with other css frameworks:
I noticed this when I wanted to get different colored highlights in alert boxes like this:
But all bootstrap color variables are colors and not strings of RGB values so this will not work.
Is it only me or would it be an improvement to put the rgb-to-color conversion with
rgb()in _settings.colors.scss and remove them from all the other css settings?Beta Was this translation helpful? Give feedback.
All reactions