Skip to content

Commit 7d03dba

Browse files
committed
fix: Refactor global variables
It's not possible to migrate away from `@import` because: ``` pnpx sass-migrator module --migrate-deps addon/styles/addon.scss ... Error: This stylesheet was loaded by a nested import in addon/styles/addon.scss. The module system only supports loading nested CSS using the load-css() mixin, which doesn't allow access to variables from the outer stylesheet. ╷ 2 │ width: calc(((100% - #{$site-container}) / 2) + 14rem); │ ^^^^^^^^^^^^^^^ ╵ addon/styles/components/_docs-viewer-x-current-page-index.scss 2:26 root stylesheet ```
1 parent 07e4f9d commit 7d03dba

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

addon/styles/_variables.scss

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Global settings
2+
$site-container: 1400px;

addon/styles/addon.scss

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Global settings
2-
$site-container: 1400px;
3-
41
@tailwind base;
52
@tailwind components;
63
@tailwind utilities;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
@use '../variables' as vars;
2+
13
.AddonDocs-DocsViewer-CurrentPageIndex {
2-
width: calc(((100% - #{$site-container}) / 2) + 14rem);
3-
padding-right: calc((100% - #{$site-container}) / 2);
4+
width: calc(((100% - #{vars.$site-container}) / 2) + 14rem);
5+
padding-right: calc((100% - #{vars.$site-container}) / 2);
46
min-width: 14rem;
57
}

0 commit comments

Comments
 (0)