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
Some difficult questions (SCSS import as string)... #108
Comments
Hello @unit-404, You can't use the See the test case js-import-css-inline-css. NoteThe |
I just needs to make support of some web-components in runtime, such as template.launcher.immersive
.wrap
.grid(part='inner')
slot
// webpackIgnore: true
style(scoped='').
@import url("./modules/uno.css");
// webpackIgnore: true
style(scoped='').
@import url("./modules/styles.css");
// exact moment, but in practice harder
style(scoped='')
include ./x-grid.scss Our project (hidden) using splitting into build phase and runtime or browser phase. |
can you please create a small repo with your use case. |
template.launcher.immersive
.wrap
.grid(part='inner')
slot
// webpackIgnore: true
style(scoped='').
@import url("./modules/uno.css");
// webpackIgnore: true
style(scoped='').
@import url("./modules/styles.css");
// exact moment, but in practice harder
- style(scoped='')
- include ./x-grid.scss
//- you can inline a style using `?inline` query (no webpack configuration required)
in generated HTML will be <style>... compiled CSS ...</style>
+ link(href='./x-grid.scss?inline' rel='stylesheet') |
I sometimes thought that |
you can use link tag in Pug anywhere, not only in head, this is just a syntax that allow you to include CSS anywhere in your template: template
div.component
link(href='./x-grid.scss?inline' rel='stylesheet' scope='some') will be compiled to (yet not implemented, it's only suggestion): <tremplate>
<div class="component">
<style scope="some">
... CSS ...
</style>
</div>
</tremplate> Would this syntax be a solution for your use case? |
I have added experimental support to include a compiled CSS directly to style(scoped='some')=require('./x-grid.scss?include') The generated HTML: <style scope="some">
... CSS ...
</style> Please, update the plugin to the version |
How to use
scss
as compiled, but inline string when import from JS?import styles from './index.scss?scss';
Tried, but there is weird effect with additional loader (in result empty string, or error when no
css-loader
).Earlier here was an error problem concerning misrepresentation.
Error: Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!
However, this is regarding
pug-loader
.The text was updated successfully, but these errors were encountered: