Skip to content

Commit d350469

Browse files
document support for bare CSS import specifiers
1 parent b2c565f commit d350469

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pages/docs/resources/styles.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,18 @@ Here is an example of using relative and shortcut paths in a CSS file:
6666
/* this would also work */
6767
@import "/node_modules/open-props/borders.min.css";
6868
@import "/node_modules/open-props/fonts.min.css";
69+
70+
/* or for packages that support an exports map */
71+
@import "open-props/borders";
72+
@import "open-props/fonts";
6973
```
7074

7175
</app-ctc-block>
7276

7377
<!-- prettier-ignore-end -->
7478

79+
> **Note**: The bare module specifier approach has limitations [in SSR scenarios](/docs/pages/server-rendering/#custom-imports) as [NodeJS custom loaders do not support `import.meta.resolve`](https://nodejs.org/api/esm.html#importmetaresolvespecifier). More information [here](https://github.com/ProjectEvergreen/greenwood/pull/1511#discussion_r2142771772).
80+
7581
The same can be done from an HTML file with a `<link>` tag:
7682

7783
<!-- prettier-ignore-start -->

0 commit comments

Comments
 (0)