Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Added the ability to import yaml/json files into the toolkit/scss #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

motleydev
Copy link

This PR adds the ability to import json, yaml and directories using import-once. I really like the idea of driving the toolkit from a data file and this allows for reuse of the variables.

…es, reusing variables across dom and stylesheets.
@LukeAskew
Copy link
Member

This is awesome. I love this idea. It helps meet a need I've heard from a lot of people.

What do you think about making an additional function more specific to just toolkit values? Something like toolkit(colors, primary, Dark). Leave the data function available, but make a shortcut for pulling toolkit values.

@motleydev
Copy link
Author

Thanks! I also like the idea of more helper functions, the only potential problem is that the importer brings the filename in as the first map variable and so the functions become file-name dependent. Not a huge issue but something to be mindful of. The only solution I can think of is to add a build script in gulp that generates helper functions using the base filename for any yaml files present in the data folder. Otherwise we just let it beak if they change the filename. :) What do you think?

@motleydev
Copy link
Author

Hey, any more thoughts on this? I'm happy to refactor according to your original concept, just curious what the status is. Thanks! I really like this project, I want to see it grow!

// Inspect is used here to silence a warning about depricating
// none-string unquoting in future versions of sass
@return $result;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a toolkit() function shortcut that pulls in the toolkit map, eliminating the first argument.

e.g.:
color: toolkit(colors, primary, Dark)

@DJTB DJTB mentioned this pull request Mar 4, 2016
@DTwigs
Copy link

DTwigs commented Mar 10, 2016

This would be huge.

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

Successfully merging this pull request may close these issues.

3 participants