-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Colors component to Contrast checker
- Loading branch information
Showing
11 changed files
with
262 additions
and
30 deletions.
There are no files selected for viewing
Binary file modified
BIN
+22.2 KB
(190%)
polaris.shopify.com/public/images/design/colors/color-palettes-roles-roles@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-464 Bytes
(98%)
...hopify.com/public/images/design/colors/color-using-color-background-dont@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+46.9 KB
(1400%)
...s.shopify.com/public/images/design/colors/color-using-color-combining-do@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+53.8 KB
(1600%)
...shopify.com/public/images/design/colors/color-using-color-combining-dont@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+54.4 KB
(1000%)
polaris.shopify.com/public/images/design/colors/color-using-color-combining@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.19 KB
(100%)
....shopify.com/public/images/design/colors/color-using-color-disabled-dont@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+29.2 KB
(320%)
polaris.shopify.com/public/images/design/colors/color-using-color-link-dont@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
...s.shopify.com/public/images/design/colors/color-using-color-surface-dont@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 105 additions & 10 deletions
115
polaris.shopify.com/src/components/Markdown/components/Colors/Colors.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,122 @@ | ||
@import '../../../../styles/variables.scss'; | ||
@import '../../../../styles/fonts.scss'; | ||
|
||
.Colors { | ||
display: grid; | ||
grid-template-columns: repeat(5, 1fr); | ||
gap: var(--p-space-4); | ||
margin-bottom: var(--p-space-8); | ||
font-size: var(--font-size-75); | ||
grid-template-columns: repeat(16, 1fr); | ||
font-size: 0.75rem; | ||
font-weight: var(--p-font-weight-semibold); | ||
|
||
@media (min-width: $breakpointTablet) { | ||
grid-template-columns: repeat(10, 1fr); | ||
grid-template-columns: repeat(16, 1fr); | ||
} | ||
|
||
h3 { | ||
font-size: 0.75rem; | ||
} | ||
|
||
.ColorsSwatch { | ||
position: relative; | ||
overflow: hidden; | ||
border-radius: var(--p-border-radius-2); | ||
margin-bottom: var(--p-space-2); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 2.5rem; | ||
overflow: visible; | ||
cursor: pointer; | ||
} | ||
|
||
&:before { | ||
.ColorsSelected { | ||
&:after { | ||
content: ''; | ||
background: url(/images/icon-do.svg) black no-repeat; | ||
background-position: center; | ||
display: block; | ||
padding-bottom: 75%; | ||
width: var(--p-space-5); | ||
height: var(--p-space-5); | ||
top: var(--p-space-5); | ||
border-radius: var(--p-border-radius-2); | ||
} | ||
} | ||
} | ||
|
||
.ColorsContainer { | ||
border-radius: var(--p-border-radius-2); | ||
overflow: hidden; | ||
margin-bottom: var(--p-space-2); | ||
} | ||
|
||
.ColorsContrastContainer { | ||
h3 { | ||
font-weight: var(--p-font-weight-semibold); | ||
} | ||
|
||
span { | ||
font-weight: var(--p-font-weight-bold); | ||
font-size: var(--font-size-900); | ||
} | ||
|
||
.ColorBox { | ||
display: flex; | ||
gap: var(--p-space-2); | ||
margin-top: var(--p-space-2); | ||
align-items: center; | ||
|
||
div { | ||
height: var(--p-space-8); | ||
width: var(--p-space-8); | ||
border-radius: var(--p-border-radius-2); | ||
border: 1px solid rgba(0, 0, 0, 0.2); | ||
display: inline-block; | ||
} | ||
|
||
span { | ||
font-size: var(--font-size-75); | ||
font-weight: var(--p-font-weight-medium); | ||
} | ||
} | ||
} | ||
|
||
.ColorsWCAG { | ||
display: inline-block; | ||
background-color: var(--surface); | ||
padding: var(--p-space-05) var(--p-space-2) var(--p-space-05) var(--p-space-5); | ||
border-radius: var(--p-space-2); | ||
font-size: var(--font-size-100); | ||
font-weight: var(--font-weight-600); | ||
line-height: 1rem; | ||
position: relative; | ||
|
||
&:after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
height: 20px; | ||
width: 20px; | ||
background-image: url(/images/icon-indeterminate.svg); | ||
background-repeat: no-repeat; | ||
background-position: left center; | ||
background-size: cover; | ||
z-index: 1; | ||
transition: var(--p-ease-out) var(--p-duration-200) all; | ||
} | ||
} | ||
|
||
.ColorsWCAGPass { | ||
background-color: var(--fill-success); | ||
color: var(--text-success-onfill); | ||
|
||
&:after { | ||
background-image: url(/images/icon-do.svg); | ||
} | ||
} | ||
|
||
.ColorsWCAGFail { | ||
background-color: var(--fill-critical); | ||
color: var(--text-critical-onfill); | ||
|
||
&:after { | ||
background-image: url(/images/icon-dont.svg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters