Nested imports / variables broken in 5.1
See original GitHub issueIn v5.0.2, it is possible to import a customized bootstrap sass file within a selector:
.new-design-system {
@import 'bootstrap-custom'
}
With this, and BS5’s new namespace, it is possible to have an older version of bootstrap side-by-side with a compartmentalized custom BS5, javascript and all. While not arguably not ideal (or not officially supported), this is extremely useful when iterating over an application with a legacy design system and gradually incorporating a new BS5-based design system.
In v5.1.0, this functionality is broken as the sass will not compile without importing functions
, variables
, and root
at the root level, which also breaks the customizations.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Nested Route Bug (forked) - StackBlitz
import { Route } from 'react-router-dom';. import { IonApp, IonRouterOutlet } from. '@ionic/react'; ... Theme variables */. import LoginPage from '.
Read more >Nested field type | Elasticsearch Guide [8.5] | Elastic
The nested type is a specialised version of the object data type that allows arrays of objects to be indexed in a way...
Read more >Understanding and Building PowerShell Modules
Learn how to do powershell module path so you can use the same code in many places without copying and pasting to code....
Read more >Unreal Engine 5.1 Release Notes
Texture and Texture Asset Editor Improvements. Textures and The Texture Asset Editor includes the following improvements for this release: You can now import...
Read more >Google Java Style Guide
5 Naming: 5.1 Rules common to all identifiers: 5.2 Rules by identifier type: 5.3 Camel case: ... Static import is not used for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is maybe related to this this libsass bug: https://github.com/sass/libsass/issues/2830
I also ran into this when using libsass 3.6.5. However, I found a couple potential workarounds:
Use dart-sass instead. The original approach of importing bootstrap inside a nested selector seems to work with dart-sass (I tested with dart-sass-embedded 1.0.0-beta.11).
I was also able to get it to work with libsass by importing the bootstrap functions into the top-level namespace. This still accomplishes what I was trying to achieve (namespacing the Bootstrap CSS classes), but this seems to sidestep the issue of libsass not finding functions defined in a nested scope:
I just attempted to reproduce the issue in a sandbox environment, but I wasn’t able to.
https://codesandbox.io/s/nested-bootstrap-5-25dud
It must be related to my configuration – possibly the python sass compiler.
The error I’m seeing in my environment is: