Skip to content

Adding support for hex colors#4

Open
sugaaloop wants to merge 1 commit intoosaton:masterfrom
sugaaloop:master
Open

Adding support for hex colors#4
sugaaloop wants to merge 1 commit intoosaton:masterfrom
sugaaloop:master

Conversation

@sugaaloop
Copy link
Copy Markdown

Hi! Not sure if you have any interest, I came across a use case for adding colors dynamically from gulp into sass (white-labeling an application) and wanted to see what you thoughts were for injecting hex colors. I needed the colors available in both sass and javascript and didn't want to define them twice.

I know it's a little hacky, but I couldn't think of a cleaner way to identify a hex color in JS.

making hex color parsing optional


checking input length before checking char[0]
@squatto
Copy link
Copy Markdown

squatto commented Sep 3, 2018

I just found this PR because I need the exact same thing: externally-defined color variables in a white labeled application. This would be great!

@squatto
Copy link
Copy Markdown

squatto commented Sep 3, 2018

@sugaaloop for now you could use this: https://github.com/giowe/gulp-sass-vars - it would be simple to export a JS object from a file so that you could dynamically set your variables.

@sugaaloop
Copy link
Copy Markdown
Author

@squatto i'm currently using my "fork". gulp-sass-vars is using parse-sass-value, which looks like exactly what we're looking for. i might check it out, but for now this PR is working well enough.

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

Successfully merging this pull request may close these issues.

2 participants