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

Multiple css files sharing .less vars file leads to duplication #306

Closed
ghost opened this issue Jul 4, 2011 · 3 comments
Closed

Multiple css files sharing .less vars file leads to duplication #306

ghost opened this issue Jul 4, 2011 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 4, 2011

Hi,

This issue is similar to #49

However my situation is slightly different:

I have a large multi section site that has a shared visual language (icons, component widths, fonts etc) that I want to include into something like a shared.css.

After that, I want to write specific rules for different section's stylesheets (Section A, Section B etc), but utilise the shared mixins.

I can import a mixin-variable.less type file at the top of the SectionA.css and SectionB.css, but then all the mixin definitions are duplicated, as they appear at the top of shared.css also.

Has anybody got any cunning ideas on how to get around this?

Cheers

Rob

@marlonvalenzuela
Copy link

Create a file, website.less, that imports your mixins-variable.less and all your other style sheets. When your file gets compiled into CSS, you'll end up with 1 CSS and no duplicate code; this is the approach I have taken for the exact same case your described. The only note that I have for you is that we're using the command line tool lessc to compile our CSS file.

@lukeapage
Copy link
Member

is this solved by import once?

@lukeapage
Copy link
Member

solved by import-once and duplicate - there are other bugs tracking the idea that the default behaviour of import should be that of import-once.

strk pushed a commit to CartoDB/carto that referenced this issue Oct 28, 2013
check for millstone.drainpool only if -l flag is passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants