Skip to content

Commit 547cb37

Browse files
committed
chore: move inline styles into SCSS modules
1 parent 4c961eb commit 547cb37

File tree

4 files changed

+41
-11
lines changed

4 files changed

+41
-11
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@use "../theme";
2+
3+
.metricsContainer {
4+
display: flex;
5+
gap: theme.spacing(2);
6+
}
7+
8+
.actionsContainer {
9+
display: flex;
10+
gap: theme.spacing(2);
11+
}

packages/component-library/src/EntityList/index.stories.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
22

33
import { Badge } from "../Badge/index.jsx";
44
import { EntityList as EntityListComponent } from "./index.jsx";
5+
import styles from "./index.stories.module.scss";
56

67
const meta = {
78
component: EntityListComponent,
@@ -196,13 +197,13 @@ export const ComplexContent: Story = {
196197
data: {
197198
project: <strong>Project Alpha</strong>,
198199
metrics: (
199-
<div style={{ display: "flex", gap: "8px" }}>
200+
<div className={styles.metricsContainer}>
200201
<Badge variant="neutral">10 feeds</Badge>
201202
<Badge variant="success">98% uptime</Badge>
202203
</div>
203204
),
204205
actions: (
205-
<div style={{ display: "flex", gap: "8px" }}>
206+
<div className={styles.actionsContainer}>
206207
<button>Edit</button>
207208
<button>Delete</button>
208209
</div>
@@ -215,13 +216,13 @@ export const ComplexContent: Story = {
215216
data: {
216217
project: <strong>Project Beta</strong>,
217218
metrics: (
218-
<div style={{ display: "flex", gap: "8px" }}>
219+
<div className={styles.metricsContainer}>
219220
<Badge variant="neutral">5 feeds</Badge>
220221
<Badge variant="warning">92% uptime</Badge>
221222
</div>
222223
),
223224
actions: (
224-
<div style={{ display: "flex", gap: "8px" }}>
225+
<div className={styles.actionsContainer}>
225226
<button>Edit</button>
226227
<button>Delete</button>
227228
</div>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@use "../theme";
2+
3+
.performanceContainer {
4+
display: flex;
5+
flex-direction: column;
6+
gap: theme.spacing(6);
7+
}
8+
9+
.performanceSection {
10+
> h3 {
11+
margin: 0;
12+
margin-bottom: theme.spacing(2);
13+
font-size: theme.font-size("lg");
14+
font-weight: 600;
15+
color: theme.color("heading");
16+
}
17+
}

packages/component-library/src/Meter/index.stories.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22

33
import { Meter as MeterComponent } from "./index.jsx";
4+
import styles from "./index.stories.module.scss";
45

56
const meta = {
67
component: MeterComponent,
@@ -159,9 +160,9 @@ export const BatteryLevel: Story = {
159160

160161
export const PerformanceScore: Story = {
161162
render: () => (
162-
<div style={{ display: "flex", flexDirection: "column", gap: "24px" }}>
163-
<div>
164-
<h3 style={{ marginBottom: "8px" }}>CPU Usage</h3>
163+
<div className={styles.performanceContainer}>
164+
<div className={styles.performanceSection}>
165+
<h3>CPU Usage</h3>
165166
<MeterComponent
166167
label="CPU usage"
167168
value={45}
@@ -171,8 +172,8 @@ export const PerformanceScore: Story = {
171172
endLabel="100%"
172173
/>
173174
</div>
174-
<div>
175-
<h3 style={{ marginBottom: "8px" }}>Memory Usage</h3>
175+
<div className={styles.performanceSection}>
176+
<h3>Memory Usage</h3>
176177
<MeterComponent
177178
label="Memory usage"
178179
value={78}
@@ -183,8 +184,8 @@ export const PerformanceScore: Story = {
183184
variant="error"
184185
/>
185186
</div>
186-
<div>
187-
<h3 style={{ marginBottom: "8px" }}>Disk Usage</h3>
187+
<div className={styles.performanceSection}>
188+
<h3>Disk Usage</h3>
188189
<MeterComponent
189190
label="Disk usage"
190191
value={30}

0 commit comments

Comments
 (0)