Closed (fixed)
Project:
Claro
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2019 at 03:29 UTC
Updated:
21 Feb 2019 at 14:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nod_And postponing this one too.
Comment #3
nod_Comment #4
huzookaComment #5
huzookaComment #6
huzookaComment #8
huzookaComment #9
nod_Is "Rhythm" clear enough? I'd use "space" or something similar than what is in figma. Then again, naming is hard
Comment #10
nod_Might be a detail but as a french person, "rhythm" is both hard to spell and hard to pronounce. From what I've seen spelling is the second most frequent issue people have after forgetting to clear the cache.
I don't look forward pointing people to those variable during sprints. "Themers" is hard enough to get right :þ
Also putting this as NW because we can reuse the naming scheme (another hard one :þ) from the typography section:
Comment #11
lauriiiThis is just another opinion, but for me at least, it would read the best if the variables would be defined as
Anyone else has any thoughts on this? I just wanted to express what I thought when I saw the patch and I'm not too keen to any particular pattern if people feel something else would be better.
Comment #12
nod_That makes sense, kinda look better too.
Comment #13
huzookaThe cases you mentioned are a really-really basic and should't be used in a component IMHO. Even if an input uses the Davy's grey for it's default border color, we should provide variable for the input border since it may change later and it's easier to change the variable of the input border than process the
form--text.css,form--checkbox-radio.cssetc.I tried to apply
[type[-element]]-[property[-state]]until now.Examples:
Could you please agree on a variable pattern that cover these as well?
Comment #14
lauriiiThe problem with providing variables for example for the border color of input is that the variable isn't reusable since it is created for a single purpose. If the components design gets updated, you would likely make other changes to the styles as well, so editing the CSS file directly shouldn't be a problem. If you want to update all of the instances of the color
--color-absolutezeroto another, you would perform simple search and replace from--color-absolutezeroto--color-absoluteten.I think we have to find a middle ground to get the best of using variables. We shouldn't be creating a single file that can control all aspects of the theme since that makes maintenance harder and abolishes all the benefits we get from using variables.
Color variables are usually the hardest to name. In my experience, the best approach is to try to come up with a name for every color and use that as a variable name, and then reference variables named after the color name directly from CSS.
Comment #15
Kami Amiga commentedHow about defining those values more precisely by adding -base at the end ?
+1 for the use of space (or spacer ?) instead of rhythm
Comment #16
huzooka@Laurii, I don't agree with you. We already have some interesting issues like the outline color change.
Let me describe with input focus outline color:
If you handle it as a component-specific var, you just had to change the
--color-input-focus. (I don't know how we can handle it as a color var right from the color palette because it had an opacity as well, but ignore this for now.) If you use it as a component-specific variable like--input-focus-color, you can change it from var(--color-absolutezero) to var(--color-newfocuscolor) without any extra efforst.This can be done easily for radios-checkboxes. And it would be hard if we don't use component-specific variables.
Comment #17
lauriiiI'm not sure if I understand how it would be easier to make the change when using variables created in a single file compared to having them in multiple files. I don't think people are able to make this kind of changes blindly in the variables file, because they have to see the context associated with the variable. Maybe in a well-established framework, this might make sense - but AFAIK we're not trying to build that. I know there are very popular libraries that are doing this so I assume there are some people who like this approach. I've worked in projects that have used a similar approach and I've always found it as extra complexity without bringing much value. Does anyone else have a different point of view on this?
Comment #18
nod_Updating the patch with what I think is better naming.
I went with lauriii. I don't think vars of vars are going to end up that useful. How much do we need to make easily configurable? I don't think it's much.
Also can we get the patch going somewhere? would like to unblock the different related issues.
Comment #20
nod_Comment #21
nod_Opened #3028765: Define CSS variable naming scheme and usage to discuss details. We can always move forward here and refactor later.
Comment #22
lauriiiOne more nitpick on this one; this variable should probably be
--line-height-instead.Comment #23
nod_You're right, rerolled + fixed.
Comment #25
nod_Comment #27
lauriiiThank you everyone!