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

Makes adding colors easier #1747

Merged
merged 1 commit into from
Apr 8, 2018
Merged

Makes adding colors easier #1747

merged 1 commit into from
Apr 8, 2018

Conversation

Come2Daddy
Copy link
Contributor

@Come2Daddy Come2Daddy commented Mar 22, 2018

This is a improvement.
As bulma colors are kind hard-coded into a map, which wrap colors and functions (findColorInvert), to extend them you have to import variables and functions then customize your style, then import derived variables and reassing colors to a merged map. Damn this is heavy. I've come to solution where you set you customizations to $custom-colors variable, the way bulma does, and then you import bulma, done.

Proposed solution

Add a function in utilities/functions.sass that handle $custom-colors to merge it with bulma's $colors droping malformated elements. Assing it to $colors in utilities/derived-variables.sass so it can be overriden and is backward compatible with 'old' integrations.

Tradeoffs

Can't see anyone... 1 call over whole project, with relatively small maps

Testing Done

Customized through $custom-colors with malformated elements, then compiled and used in html page. All custom (proper) and base colors where accessible with .is-#{name} classes dependent of colors.

Just map your colors, the bulma way ($name: ($color[,$invert]) into $custom-colors, and import bulma.
Note that, you can provide only the color as the inverted would be computed from it.
@jgthms
Copy link
Owner

jgthms commented Mar 22, 2018

Nice! I'll have a look.

@jgthms
Copy link
Owner

jgthms commented Apr 8, 2018

Great stuff! I'm gonna add some documentation, and also add a $custom-shades variable.

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

Successfully merging this pull request may close these issues.

2 participants