Skip to content

Commit

Permalink
Merge pull request #45 from simin4950/contrast
Browse files Browse the repository at this point in the history
Adding prefers-contrast: less to css accessibility snippets
  • Loading branch information
kendallgassner authored Oct 1, 2021
2 parents 3254753 + 03e0479 commit e53a333
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
### CSS snippet

- reduced motion - adds a reduced motion snippet with prefix `transition`
🚨 Safari Only Queries 🚨
- less-contrast - adds less contrast media snippet with prefix `less-contrast`

- dark-color-scheme - adds dark prefers-color-scheme snippet with prefix `darkColorScheme`

Expand Down
40 changes: 28 additions & 12 deletions snippets/css-snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
{
"transition": {
"prefix": ["transition"],
"body": [
"transition: \t$1",
"",
"@media screen and (prefers-reduced-motion) {",
"transition: \t$0",
"}"
],
"description": "Adds reduced motion media query anytime transition is added to css file"
},
"transition": {
"prefix": [
"transition",
],
"body": [
"transition: \t$1",
"",
"@media screen and (prefers-reduced-motion) {",
"transition: \t$0",
"}"
],
"description": "Adds reduced motion media query anytime transition is added to css file"
},

"contrast": {
"prefix": [
"less-contrast",
],
"body": [
"@media (prefers-contrast: less) {",
"\t$0",
"}"

],
"description": "Detects if user has requested that the web content is presented with less constrast. Note that this is only supported on Safari."
},

"darkColorScheme": {
"prefix": ["darkColorScheme"],
"body": [
Expand All @@ -20,4 +36,4 @@
],
"description": "Adds dark color scheme media query whenever user indicates dark theme in the operating system settings"
}
}
}

0 comments on commit e53a333

Please sign in to comment.