Skip to content

Commit f7d86db

Browse files
authored
fix: change box-sizing to have less specificity (#1151)
1 parent b824136 commit f7d86db

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Diff for: .changeset/gorgeous-queens-kick.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aws-amplify/ui": patch
3+
---
4+
5+
fix: change box-sizing to have less specificity

Diff for: docs/src/styles/docs/base.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ html {
3838

3939
// Remove this when this gets fixed in the UI package
4040
* {
41-
box-sizing: border-box;
42-
4341
/* Selection */
4442
&::-moz-selection {
4543
background: var(--amplify-colors-overlay-10);
@@ -111,7 +109,9 @@ code {
111109
background-color: var(--amplify-colors-background-secondary);
112110
font-size: 0.875em;
113111
border-radius: 0.3em;
114-
font-family: "Source Code Pro", "Fira Code", "Fira Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
112+
font-family: 'Source Code Pro', 'Fira Code', 'Fira Mono', ui-monospace,
113+
SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
114+
monospace;
115115
direction: ltr;
116116
text-align: left;
117117
white-space: pre;

Diff for: packages/ui/src/theme/css/styles.scss

+7-6
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
}
1414
}
1515

16-
[class*='amplify'] {
17-
all: unset; /* protect against external styles */
16+
// Note: This rule can be easily overwritten when
17+
// needed due to very low specificity of 0 0 0
18+
* {
19+
box-sizing: border-box;
1820
}
1921

20-
// Must be defined AFTER `[class*='amplify']
21-
// or rules will be unset to initial/default
22-
[data-amplify-theme] * {
23-
box-sizing: border-box;
22+
[class*='amplify'] {
23+
all: unset; /* protect against external styles */
24+
box-sizing: border-box; /* set box-sizing after unset above */
2425
}
2526

2627
.sr-only {

0 commit comments

Comments
 (0)