Skip to content

Commit

Permalink
fix: change box-sizing to have less specificity (#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
reesscot authored Feb 2, 2022
1 parent b824136 commit f7d86db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-queens-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui": patch
---

fix: change box-sizing to have less specificity
6 changes: 3 additions & 3 deletions docs/src/styles/docs/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ html {

// Remove this when this gets fixed in the UI package
* {
box-sizing: border-box;

/* Selection */
&::-moz-selection {
background: var(--amplify-colors-overlay-10);
Expand Down Expand Up @@ -111,7 +109,9 @@ code {
background-color: var(--amplify-colors-background-secondary);
font-size: 0.875em;
border-radius: 0.3em;
font-family: "Source Code Pro", "Fira Code", "Fira Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-family: 'Source Code Pro', 'Fira Code', 'Fira Mono', ui-monospace,
SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
monospace;
direction: ltr;
text-align: left;
white-space: pre;
Expand Down
13 changes: 7 additions & 6 deletions packages/ui/src/theme/css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
}
}

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

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

.sr-only {
Expand Down

0 comments on commit f7d86db

Please sign in to comment.