on master help sign in
feat: add syntax tests for sass
commit3c756a65a61219d7a68aa1551dbda45b5464a030 authorZachary J. Rollyson <me@zjr.io> dateSat 17 Oct 2020, 10:22 (6 years ago) parent8d57482
2 files changed+152
tests/syntax-tests/highlighted/Sass/example.sass+76 tests/syntax-tests/source/Sass/example.sass+76
tests/syntax-tests/highlighted/Sass/example.sassnew file+76
@@ -0,0 +1,76 @@
1+@import "fonts"
2+
3+$theme_dark: (
4+ "background-color": null
5+)
6+
7+$theme_main: (
8+ "text-size": 3em
9+ "text-color": black
10+ "text-shadow": #36ad 0px 0px 3px
11+ "card-background": #d6f
12+ "card-shadow": #11121212 0px 0px 2px 1px
13+ "card-padding": 1rem
14+ "card-margin": 0.5in
15+ "image-width": 600px
16+ "image-height": 100vh
17+ "background-color": #dedbef
18+ "i-ran-out-of-placeholders-for-units": (
19+ 1vw 100% 60pt
20+ )
21+)
22+
23+$current_theme: $theme_main
24+
25+@mixin themed()
26+ $current_theme: $theme_main !global
27+ @content
28+
29+ @media (prefers-color-scheme: dark)
30+ $current_theme: $theme_dark !global
31+ @content
32+
33+ .#{"dark"} &
34+ $current_theme: $theme_dark !global
35+ @content
36+
37+@function theme($variable)
38+ @if map-has_key($current_theme, $variable)
39+ @return map-get($current_theme, $variable)
40+ @else
41+ @error "Unknown theme variable: #{$variable}"
42+
43+body
44+ @include themed
45+ background-color: theme("background-color")
46+ background-image: url("https://github.com/sharkdp/bat/raw/master/doc/logo-header.svg")
47+
48+
49+ header[data-selectable="false"]
50+ -webkit-user-select: none
51+ -moz-user-select: none
52+ -ms-user-select: /* CSS comment */ none
53+ cursor: default !important // Sass comment
54+
55+
56+ > div
57+ border: #04f 1px solid
58+
59+ &::after
60+ content: "Pseudo"
61+ color: #2f5f7f
62+ box-sizing: border-box
63+
64+@keyframes rotate
65+ 0%
66+ transform: rotate(0deg)
67+ 50%
68+ transform: rotate(180deg)
69+ 100%
70+ transform: rotate(0rad)
71+
72+@font-face
73+ font-family: "Example Font"
74+ src: url(example.ttf) format("ttf")
75+ src: local("Comic Sans MS")
76+
tests/syntax-tests/source/Sass/example.sassnew file+76
@@ -0,0 +1,76 @@
1+@import "fonts"
2+
3+$theme_dark: (
4+ "background-color": null
5+)
6+
7+$theme_main: (
8+ "text-size": 3em
9+ "text-color": black
10+ "text-shadow": #36ad 0px 0px 3px
11+ "card-background": #d6f
12+ "card-shadow": #11121212 0px 0px 2px 1px
13+ "card-padding": 1rem
14+ "card-margin": 0.5in
15+ "image-width": 600px
16+ "image-height": 100vh
17+ "background-color": #dedbef
18+ "i-ran-out-of-placeholders-for-units": (
19+ 1vw 100% 60pt
20+ )
21+)
22+
23+$current_theme: $theme_main
24+
25+@mixin themed()
26+ $current_theme: $theme_main !global
27+ @content
28+
29+ @media (prefers-color-scheme: dark)
30+ $current_theme: $theme_dark !global
31+ @content
32+
33+ .#{"dark"} &
34+ $current_theme: $theme_dark !global
35+ @content
36+
37+@function theme($variable)
38+ @if map-has_key($current_theme, $variable)
39+ @return map-get($current_theme, $variable)
40+ @else
41+ @error "Unknown theme variable: #{$variable}"
42+
43+body
44+ @include themed
45+ background-color: theme("background-color")
46+ background-image: url("https://github.com/sharkdp/bat/raw/master/doc/logo-header.svg")
47+
48+
49+ header[data-selectable="false"]
50+ -webkit-user-select: none
51+ -moz-user-select: none
52+ -ms-user-select: /* CSS comment */ none
53+ cursor: default !important // Sass comment
54+
55+
56+ > div
57+ border: #04f 1px solid
58+
59+ &::after
60+ content: "Pseudo"
61+ color: #2f5f7f
62+ box-sizing: border-box
63+
64+@keyframes rotate
65+ 0%
66+ transform: rotate(0deg)
67+ 50%
68+ transform: rotate(180deg)
69+ 100%
70+ transform: rotate(0rad)
71+
72+@font-face
73+ font-family: "Example Font"
74+ src: url(example.ttf) format("ttf")
75+ src: local("Comic Sans MS")
76+