How to migrate cases that make use of @content and @import with @content and @forward
See original GitHub issueI’m migrating a codebase from using @import
to @use
and @forward
. Most of it is okay but I’m unsure what to do in a case where @import
is used with @content
.
Considering the following mixing that the only goal is to wrap styles in a class:
@mixin alternative-styles {
.parent-class {
@content;
}
}
The mixin is then used with @import
to wrap all those styles in a .parent-class
:
@include alternative-styles {
@import 'components';
}
I assumed replacing it with a @forward
wouldn’t work but have it a try anyway in this way:
@include alternative-styles {
@forward 'components';
}
This threw the following error:
Error: This at-rule is not allowed here.
╷
22 │ @forward 'components';
│ ^^^^^^^^^^^^^^^^^^^^^
╵
Is there any way to achieve wrapping a bunch of styles in a class that supports the @use
and @forward
rules?
Thanks a lot in advance!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to migrate cases that make use of @content and @import ...
I found that the meta.load-css mixin actually does work after creating a separate prototype with the same structure: @use 'sass:meta'; @use ...
Read more >Tableau Content Migration Tool Use Cases
Select the content you want to migrate from your source site. You can select entire projects, specific workbooks and data sources, and user...
Read more >Here's How to Migrate Data to Content In Salesforce - Altvia
Attachments & Document Files: Start by doing a full Export including all files from within SF. This will get you all the attachments,...
Read more >Migrate Content - Box Support
Potential migration methods · Drag and Drop Files · Upload Folders · FTP · Box Shuttle – content migration at scale.
Read more >Import Your Team's Data Into G Suite - Zapier
Just open the G Suite Admin page and select Migration, or go directly to admin.google.com/AdminHome#Migration. Select what you'd like to import ...
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
You shouldn’t need to do a separate compilation.
Do
components/buttons
andcomponents/text
actually emit any CSS? If they do, it should be included bymeta.load-css
.I have found that the
sass-migration
tool solves the issue this way:The
components.scss
files has multiple@forward
statements to keep all component references in one place like this:After the sass compiler runs it results in an empty block: