Skip to content

Commit 82fe9b4

Browse files
committed
refactor(css): modularize exports and variables
1 parent 4cea65b commit 82fe9b4

36 files changed

+107
-214
lines changed

website/src/components/Navbar/styles.export.module.scss renamed to website/src/components/Navbar/_exports.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@use "@/styles/utils";
2-
@use "./styles.module.scss" as *;
2+
@use "./vars" as *;
33

44
:export {
55
navbarHeight: utils.strip-units($navbar-height);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// AUTOGENERATED FILE -- DO NOT EDIT DIRECTLY
2+
declare namespace ExportsModuleScssNamespace {
3+
export interface IExportsModuleScss {
4+
navbarHeight: string;
5+
}
6+
}
7+
8+
declare const ExportsModuleScssModule: ExportsModuleScssNamespace.IExportsModuleScss;
9+
10+
export = ExportsModuleScssModule;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$navbar-height: 76px;
2+
$logo-size: 60px;

website/src/components/Navbar/styles.export.module.scss.d.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

website/src/components/Navbar/styles.module.scss

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
@use "@/styles/colors";
2-
3-
$navbar-height: 76px;
4-
$logo-size: 60px;
2+
@use "./vars";
53

64
.navbar {
75
z-index: 10;
86
position: sticky;
97
top: 0;
108
width: 100%;
11-
height: $navbar-height;
9+
height: vars.$navbar-height;
1210
background-color: colors.$white;
1311
border-bottom: 1px solid #dddddd;
1412
padding: 0.5rem 2rem;
@@ -28,8 +26,8 @@ $logo-size: 60px;
2826
font-weight: 700;
2927

3028
> img {
31-
width: $logo-size;
32-
height: $logo-size;
29+
width: vars.$logo-size;
30+
height: vars.$logo-size;
3331
}
3432
}
3533
}

website/src/components/Sidebar/SidebarItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import c from "clsx";
1111

1212
import { Collapsible, useCollapsible } from "@/components/Collapsible";
1313
import { canUseDOM } from "@/utils/environment";
14+
1415
import SidebarItems from "./SidebarItems";
1516

1617
import s from "./styles.module.scss";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$desktop-sidebar-width: 300px;

website/src/components/Sidebar/styles.module.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
@use "@/styles/colors";
99
@use "@/styles/mixins";
10-
11-
$desktop-sidebar-width: 300px;
10+
@use "./vars";
1211

1312
.items {
1413
list-style: none;
@@ -79,6 +78,6 @@ $arrow-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg
7978

8079
.desktop {
8180
@include mixins.desktop-only() {
82-
width: $desktop-sidebar-width;
81+
width: vars.$desktop-sidebar-width;
8382
}
8483
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$desktop-toc-width: 200px;

website/src/components/Toc/styles.module.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
@use "@/styles/mixins";
99
@use "@/styles/colors";
1010

11-
$desktop-toc-width: 200px;
12-
1311
.items {
1412
&, ul {
1513
list-style-type: none;

0 commit comments

Comments
 (0)