Skip to content

Commit 991c775

Browse files
authored
chore: enforce to use logical css (#101)
1 parent 2b47586 commit 991c775

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

.stylelintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,14 @@
1616
}
1717
]
1818
},
19-
"plugins": ["@cloudscape-design/build-tools/stylelint"]
19+
"plugins": ["stylelint-use-logical", "@cloudscape-design/build-tools/stylelint"],
20+
"overrides": [
21+
{
22+
"files": ["./src/**/*.scss"],
23+
"rules": {
24+
"property-disallowed-list": ["border", "border-radius", "border-style", "margin", "padding"],
25+
"csstools/use-logical": "always"
26+
}
27+
}
28+
]
2029
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"stylelint": "^16.9.0",
111111
"stylelint-config-recommended-scss": "^14.1.0",
112112
"stylelint-prettier": "^5.0.2",
113+
"stylelint-use-logical": "^2.1.2",
113114
"typescript": "^4.9.4",
114115
"vite": "^6.4.1",
115116
"vitest": "^3.2.4"

src/chat-bubble/styles.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
display: flex;
2323
flex-direction: column;
2424
gap: cs.$space-scaled-s;
25-
padding: cs.$space-scaled-s;
26-
min-width: 0;
25+
padding-block: cs.$space-scaled-s;
26+
padding-inline: cs.$space-scaled-s;
27+
min-inline-size: 0;
2728
overflow-x: auto;
2829

2930
border-start-start-radius: cs.$border-radius-chat-bubble;

src/internal/shared.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
inset-block-start: calc(-1 * #{$gutter});
2525
inline-size: calc(100% + 2 * #{$gutter});
2626
block-size: calc(100% + 2 * #{$gutter});
27-
border-radius: $border-radius;
28-
border: $border-width solid $border-color;
27+
border-start-start-radius: $border-radius;
28+
border-start-end-radius: $border-radius;
29+
border-end-start-radius: $border-radius;
30+
border-end-end-radius: $border-radius;
31+
border-block: $border-width solid $border-color;
32+
border-inline: $border-width solid $border-color;
2933
}
3034
}
3135

src/loading-bar/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
.variant-gen-ai,
3030
.variant-gen-ai-masked {
31-
height: 2px;
31+
block-size: 2px;
3232
background: awsui.$color-background-loading-bar-gen-ai;
3333
background-size: 200% 100%;
3434
background-position: 0 100%;

src/support-prompt-group/styles.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
color: awsui.$color-text-button-normal-default;
3232
background: awsui.$color-background-button-normal-default;
3333

34-
border: 1px solid awsui.$color-border-button-normal-default;
34+
border-block: 1px solid awsui.$color-border-button-normal-default;
35+
border-inline: 1px solid awsui.$color-border-button-normal-default;
3536
border-start-start-radius: awsui.$space-static-xs;
3637
border-start-end-radius: awsui.$space-static-xs;
3738
border-end-start-radius: awsui.$space-static-xs;

0 commit comments

Comments
 (0)