Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color var() names in the ECL guidelines [feature] #3750

Open
joarod-eu opened this issue Dec 13, 2024 · 2 comments
Open

Add color var() names in the ECL guidelines [feature] #3750

joarod-eu opened this issue Dec 13, 2024 · 2 comments

Comments

@joarod-eu
Copy link
Contributor

Expected behavior

Using CSS var() colors are the best practice to keep all components aligned with the same UI. Searching for the right color in the guidelines will be helpful for developers and designers so we can customize external components quicker.

Actual behavior

ECL color guidelines show the hexadecimal color code but not the CSS var() name. Impossible to know which var name is associated.

Steps to reproduce the issue

Visit the page:
https://ec.europa.eu/component-library/ec/guidelines/colours/

Find the color needed, inspect the element in the list. No var() name is declared or used. All colors are hardcoded in rgb format. The only way to know the CSS var() color associated is to copy the hexadecimal color, then go to the ecl-ec.css or ecl-eu.css an search by #hex code the variable associated.

@joarod-eu joarod-eu changed the title Add color var() names in the ECL guidelines Add color var() names in the ECL guidelines [feature] Dec 13, 2024
@planctus
Copy link
Collaborator

Mmhh..well, @joarod-eu

Impossible to know which var name is associated.

The name of the custom properties we define for colors is standardised, --ecl-color-{name of the color}, i agree that we should at least mention this in the guildelines about colors, but difficult to say that the only way to retrieve the variable name is to copy the hex code and look for it in the compiled css.
We will consider explicitely showing the custom property relative to each color, for the time being now you know the "rule" for naming them, no need to look into the ec/eu css :)

@joarod-eu
Copy link
Contributor Author

Hi @planctus, thanks for the quick reply.

That info that you just shared now

The name of the custom properties we define for colors is standardised, --ecl-color-{name of the color}

is gold for new developers and I'm agree that mentioning that in the guidelines will help a lot!

I will share it with my team and design agency, and invite you to include it in the documentation as it is useful information for those starting to work with ECL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants