Add: SASS - Contrast, Animate mixin

This commit is contained in:
alstjr7375 2022-03-17 09:34:37 +09:00
parent 7900be0e18
commit a510983b36
2 changed files with 81 additions and 0 deletions

View file

@ -80,3 +80,66 @@
}
}
}
@include test-module("Color contrast [mix]") {
@include test("simple") {
@include assert {
@include output {
@include color_scheme.Contrast {
body {
font-size: 16px;
}
}
}
@include expect {
@media (prefers-contrast) {
body {
font-size: 16px;
}
}
}
}
}
}
@include test-module("Color not contrast [mix]") {
@include test("simple") {
@include assert {
@include output {
@include color_scheme.NotContrast {
body {
font-size: 16px;
}
}
}
@include expect {
@media not all and (prefers-contrast) {
body {
font-size: 16px;
}
}
}
}
}
}
@include test-module("Animate, not reduced motion [mix]") {
@include test("simple") {
@include assert {
@include output {
@include color_scheme.Animate {
body {
font-size: 16px;
}
}
}
@include expect {
@media (prefers-reduced-motion: no-preference) {
body {
font-size: 16px;
}
}
}
}
}
}

View file

@ -10,3 +10,21 @@
@content;
}
}
@mixin Contrast() {
@media (prefers-contrast) {
@content;
}
}
@mixin NotContrast() {
@media not all and (prefers-contrast) {
@content;
}
}
@mixin Animate() {
@media (prefers-reduced-motion: no-preference) {
@content;
}
}