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

Suggestion: make it easy to export multiple CSS files for themes #1809

Open
ghost opened this issue Mar 16, 2015 · 1 comment
Open

Suggestion: make it easy to export multiple CSS files for themes #1809

ghost opened this issue Mar 16, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 16, 2015

If I'm not mistaken, if I want to allow a user to change colour themes, I need multiple copies of the same CSS file, and then I just import my LESS variables into the top. It would be really cool if Web Essentials could make this process easier for me. Have one CSS file that gets duplicated for as many themes as I have where the only change is the LESS file that has the different variables at the top.

One CSS file has @import theme1.css
And the next has @import theme2.css
etc.

When my LESS gets compiled, all those CSS files get written out each time to allow my users to swap out the CSS file they're using.

What do you think?

@am11
Copy link
Contributor

am11 commented May 1, 2015

I think you might want to do it the standard/pure Less way, by defining the theme name as variable in, for instance, @build-yellow-theme.less, @build-rad-theme.less etc. and then import your main.less after declaring the theme name to conform with DRY. The main.less will then contain @import '{my_path}{my_theme_name}'; (or simply @import my_theme_name_with_path; without string interpolation), where my_theme_name is a variable defined somewhere before in callstack. See less/less.js#2246 for more details.

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

1 participant