This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Gh154 restructure less build to allow ampersand to not have fuelux in parents #155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is to achieve parity with fuelux, and is essentially identical to: ExactTarget/fuelux#1047
Purpose
The proposed change would allow us to begin to use the
&
parent selector that LESS provides more effectively.Overview
The less build should be able to be slightly restructured so that the
.fuelux
wrapper class name is not in the parent-chain (&
) during the main LESS compilation, and instead gets tacked onto the front of the rules after the fact.The CSS file ultimately output ought not be any different after making this change, since the
&
selector currently goes under-utilized (due, of course, to the quirks of our current process).Simple example
From the LESS documentation on Changing Selector Order.
Given the following code:
...the way we are currently building the LESS would render the .css as:
Note the stray
.fuelux
that is inserted after the.no-borderradius
selector, which is not what the developer intended.The restructure would output as:
The Actual Restructure Proposal
Introduces a new .less file at
less/fuelux-override.less
that does the initial compilation of the fuelux overrides not inside the.fuelux
wrapper.It outputs a temporary "non-namespaced" file, located at
less/fuelux-override-no-namespace.less
.The fuelux-mctheme.less is changed so that it imports the
less/fuelux-override-no-namespace.less
file inside the wrapper -- tacking the.fuelux
"namespace" onto the rules for the overrides.The grunt task doing this outputs the resulting .css into it's final home at
/dist/css/fuelux-mctheme.css
, and then deletes the temporary file.The temporary file is also added to
.gitignore
to ensure that a failed LESS build does not result in the temp file not being deleted and inadvertently checked into the repository.