mirror of
https://github.com/black7375/Firefox-UI-Fix.git
synced 2025-12-06 02:30:54 -08:00
Clean: Test - Separated example
This commit is contained in:
parent
4b1bc67f59
commit
89cb286d33
6 changed files with 67 additions and 118 deletions
|
|
@ -1,4 +1,5 @@
|
|||
@use 'true' as *;
|
||||
@use "example" as *;
|
||||
@use "../src/utils/color_scheme";
|
||||
|
||||
@include test-module("Color scheme is dark [mix]") {
|
||||
|
|
@ -6,16 +7,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include color_scheme.Dark {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (-moz-toolbar-prefers-color-scheme: dark), (prefers-color-scheme: dark) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,16 +21,16 @@
|
|||
@include test("simple reversed") {
|
||||
@include assert {
|
||||
@include output {
|
||||
body {
|
||||
@include example_tag {
|
||||
@include color_scheme.Dark {
|
||||
font-size: 16px;
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (-moz-toolbar-prefers-color-scheme: dark), (prefers-color-scheme: dark) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
@include example_tag {
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,16 +43,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include color_scheme.Light {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (-moz-toolbar-prefers-color-scheme: light), (prefers-color-scheme: light) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -64,16 +57,16 @@
|
|||
@include test("simple reversed") {
|
||||
@include assert {
|
||||
@include output {
|
||||
body {
|
||||
@include color_scheme.Light {
|
||||
font-size: 16px;
|
||||
@include example_tag {
|
||||
@media (-moz-toolbar-prefers-color-scheme: light), (prefers-color-scheme: light) {
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (-moz-toolbar-prefers-color-scheme: light), (prefers-color-scheme: light) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
@include example_tag {
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -86,16 +79,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include color_scheme.Contrast {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (prefers-contrast) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -107,16 +96,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include color_scheme.NotContrast {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media not all and (prefers-contrast) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -128,16 +113,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include color_scheme.Animate {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
@use 'true' as *;
|
||||
@use "example" as *;
|
||||
@use "../src/utils/each";
|
||||
|
||||
@include test-module("Create each at rules [mix]") {
|
||||
|
|
@ -6,16 +7,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include each.AtEach("-moz-document", "about:home", "url") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@-moz-document url(about:home) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26,16 +23,12 @@
|
|||
@include output {
|
||||
$input: "about:home" "about:newtab";
|
||||
@include each.AtEach("-moz-document", $input, "url") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@-moz-document url(about:home), url(about:newtab) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -45,16 +38,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include each.AtEach("media", "max-width: 1024px") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (max-width: 1024px) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,16 +54,12 @@
|
|||
@include output {
|
||||
$input: "hover: hover" "max-width: 1024px";
|
||||
@include each.AtEach("media", $input) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (hover: hover), (max-width: 1024px) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -84,16 +69,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include each.AtEach("supports", "userChrome.tab.photon", "-moz-bool-pref", " or ") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@supports -moz-bool-pref(userChrome.tab.photon) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -104,16 +85,12 @@
|
|||
@include output {
|
||||
$input: "userChrome.tab.photon" "userChrome.padding.photon";
|
||||
@include each.AtEach("supports", $input, "-moz-bool-pref", " or ") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@supports -moz-bool-pref(userChrome.tab.photon) or -moz-bool-pref(userChrome.padding.photon) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
__tests__/example.scss
Normal file
14
__tests__/example.scss
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@mixin example_tag() {
|
||||
body {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin example_property() {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@mixin example() {
|
||||
@include example_tag {
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
@use 'true' as *;
|
||||
@use "example" as *;
|
||||
@use "../src/utils/media";
|
||||
|
||||
// TODO: Need more tests..
|
||||
|
|
@ -8,16 +9,12 @@
|
|||
@include output {
|
||||
$input: "hover: hover" "max-width: 1024px";
|
||||
@include media.each($input...) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@media (hover: hover), (max-width: 1024px) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +24,7 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
$input: "hover: hover" "max-width: 1024px";
|
||||
body {
|
||||
@include example_tag {
|
||||
@include media.each($input...) {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
|
@ -35,8 +32,8 @@
|
|||
}
|
||||
@include expect {
|
||||
@media (hover: hover), (max-width: 1024px) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
@include example_tag {
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -47,9 +44,9 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
$input: ();
|
||||
body {
|
||||
@include example_tag {
|
||||
@include media.each($input) {
|
||||
font-size: 16px;
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -62,9 +59,9 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
$input: (null);
|
||||
body {
|
||||
@include example_tag {
|
||||
@include media.each($input) {
|
||||
font-size: 16px;
|
||||
@include example_property;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
@use 'true' as *;
|
||||
@use "example" as *;
|
||||
@use "../src/utils/option";
|
||||
|
||||
@include test-module("If exist pref [mix]") {
|
||||
|
|
@ -6,16 +7,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include option.Option("userChrome.tab.photon") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@supports -moz-bool-pref(userChrome.tab.photon) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,16 +22,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include option.Option("userChrome.tab.photon", "userChrome.padding.photon") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@supports -moz-bool-pref(userChrome.tab.photon) or -moz-bool-pref(userChrome.padding.photon) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,16 +39,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include option.NotOption("userChrome.tab.photon") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@supports not -moz-bool-pref(userChrome.tab.photon) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,16 +54,12 @@
|
|||
@include assert {
|
||||
@include output {
|
||||
@include option.Option("userChrome.tab.photon", "userChrome.padding.photon") {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
@include expect {
|
||||
@supports -moz-bool-pref(userChrome.tab.photon) or -moz-bool-pref(userChrome.padding.photon) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
@include example;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
@use 'true' as *;
|
||||
@use "example" as *;
|
||||
@use "../src/utils/os" as *;
|
||||
|
||||
// TODO: Need more tests..
|
||||
@mixin example() {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@include test-module("Create OS related media [mix]") {
|
||||
@include test("win7") {
|
||||
@include assert {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue