-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
add "namespace" to imported files #2256
Comments
Parent selectors are not the only problem of such Bootstrap usage (see #2052 (comment)). |
Since version 2.x may be this problem could be resolved with a Plugin. It would be some thing like Or to handle a separate import may be it could be triggered after a import is evald. |
Which one? Yet again there're several unrelated problems with namespacing a library (a mentioned the issue with the the list above). And I can't see how a plugin can do anything about this... (could you elaborate?) Speaking of the "calc problem" (I'm sorry I don't know why I did not comment that above), the solution is as simple as: just compile your "second pass" code with |
👍 @seven-phases-max You seem to have added the Edit: I ended up using https://github.com/ruslansavenok/postcss-wrap after the whole LESS is done compiling. |
@mathieumg The label roughly means "the feature should not or cannot be implemented in the core, but can be supported via plugin". |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I need to add a base class to all rules for imported resources.
I have a project that use bootstrap less files to build an own theme.
I need to "namespace" all rules, to ensure, that the css rules only match in a subtree of document tree.
I tried to wrap all imports with the a base class like this:
but than, the "Parent Selectors" with "Changing selector order" makes problems.
Example:
rule in imported less file:
output after wrapping:
The second rule do not match anymore!
What I want as result is:
The only way I found is to run less two times and produce a temporary css file, that I import in second run like this:
But than I got wrong results for CSS calc function.
Input first run:
Result in temp.css:
Result after wrapping:
It would be nice, if there would be a way to handle this in one run.
May be with a special import option to prevent the "Changing selector order" of "Parent Selectors" to go outside an import
or a global option for less that it can add a base class to all css rules after regular processing.
The text was updated successfully, but these errors were encountered: