test: add more integration tests with insta. Like it!
This commit is contained in:
parent
3b8d1aa6f2
commit
45ba23e962
15 changed files with 413 additions and 21 deletions
19
tests/assets/mixin-module.sass
Normal file
19
tests/assets/mixin-module.sass
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
@mixin color($color: black)
|
||||
@if $color == black
|
||||
color: white
|
||||
background-color: green
|
||||
@else if $color == white
|
||||
color: red
|
||||
background-color: black
|
||||
@else
|
||||
color: #c6c6c6
|
||||
background-color: #00ffff
|
||||
&::after
|
||||
content: 'Colored'
|
||||
color: $color
|
||||
background-color: blue
|
||||
&:hover
|
||||
transform: scale(2)
|
||||
&:hover
|
||||
transform: translateX(10%)
|
||||
24
tests/assets/mixin-module.scss
Normal file
24
tests/assets/mixin-module.scss
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
@mixin surface($color: black){
|
||||
@if $color == black{
|
||||
color: white;
|
||||
background-color: green;
|
||||
}@else if $color == white{
|
||||
color: red;
|
||||
background-color: black;
|
||||
}@else{
|
||||
color: #c6c6c6;
|
||||
background-color: #00ffff;
|
||||
}
|
||||
&::after{
|
||||
content: 'Colored';
|
||||
color: $color;
|
||||
background-color: blue;
|
||||
&:hover{
|
||||
transform: scale(2);
|
||||
}
|
||||
}
|
||||
&:hover{
|
||||
transform: translateX(10%);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@mixin colored($color: primary)
|
||||
@if $color == primary
|
||||
color: white
|
||||
@else
|
||||
color: $col
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
$primary-color: black;
|
||||
|
||||
@mixin colored($col: primary) {
|
||||
@if $col == primary {
|
||||
color: $primary-color;
|
||||
} @else {
|
||||
color: $col;
|
||||
}
|
||||
}
|
||||
3
tests/assets/module-forward.sass
Normal file
3
tests/assets/module-forward.sass
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
@forward 'mixins_a'
|
||||
@forward 'mixins_c'
|
||||
3
tests/assets/module-forward.scss
Normal file
3
tests/assets/module-forward.scss
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
@forward 'mixins_a';
|
||||
@forward 'mixins_c';
|
||||
15
tests/assets/module-usage.sass
Normal file
15
tests/assets/module-usage.sass
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
@use 'mixins_a' as *
|
||||
@use 'mixins_c' as *
|
||||
|
||||
.coated
|
||||
@include color(green)
|
||||
@include surface(black)
|
||||
&-dark
|
||||
@include surface(red)
|
||||
a
|
||||
@include surface(blue)
|
||||
img
|
||||
@include color(black)
|
||||
span
|
||||
@include color(green)
|
||||
display: block
|
||||
20
tests/assets/module-usage.scss
Normal file
20
tests/assets/module-usage.scss
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@use 'mixins_a' as *;
|
||||
@use 'mixins_c' as *;
|
||||
|
||||
.coated{
|
||||
@include color(green);
|
||||
@include surface(black);
|
||||
&-dark{
|
||||
@include surface(red);
|
||||
a{
|
||||
@include surface(blue);
|
||||
img{
|
||||
@include color(black);
|
||||
}
|
||||
}
|
||||
}
|
||||
span{
|
||||
@include color(green);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
3
tests/assets/prelude.css
Normal file
3
tests/assets/prelude.css
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
html {
|
||||
background-color: dark;
|
||||
}
|
||||
5
tests/assets/prelude.sass
Normal file
5
tests/assets/prelude.sass
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@use 'mixins_a' as *
|
||||
@use 'mixins_c' as *
|
||||
|
||||
body
|
||||
@include color()
|
||||
6
tests/assets/prelude.scss
Normal file
6
tests/assets/prelude.scss
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
@use 'mixins_a' as *;
|
||||
@use 'mixins_c' as *;
|
||||
|
||||
body {
|
||||
@include surface();
|
||||
}
|
||||
17
tests/assets/sole-code.sass
Normal file
17
tests/assets/sole-code.sass
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
.fuzz
|
||||
background-color: red
|
||||
display: block
|
||||
&-dark
|
||||
background-color: black
|
||||
color: white
|
||||
a
|
||||
text-transform: uppercase
|
||||
img
|
||||
position: absolute
|
||||
top: 0
|
||||
left: 10rem
|
||||
span
|
||||
position: relative
|
||||
display: grid
|
||||
grid-template-areas: 'a b c' 'd e f' 'x x x'
|
||||
display: block
|
||||
22
tests/assets/sole-code.scss
Normal file
22
tests/assets/sole-code.scss
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.fuzz{
|
||||
background-color: red;
|
||||
display: block;
|
||||
&-dark{
|
||||
background-color: black;
|
||||
color: white;
|
||||
a{
|
||||
text-transform: uppercase;
|
||||
img{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
span{
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-areas: 'a b c' 'd e f' 'x x x';
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
14
tests/assets/use-forwarded.sass
Normal file
14
tests/assets/use-forwarded.sass
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@use 'module_a' as *
|
||||
|
||||
.coated
|
||||
@include color(green)
|
||||
@include surface(black)
|
||||
&-dark
|
||||
@include surface(red)
|
||||
a
|
||||
@include surface(blue)
|
||||
img
|
||||
@include color(black)
|
||||
span
|
||||
@include color(green)
|
||||
display: block
|
||||
20
tests/assets/use-forwarded.scss
Normal file
20
tests/assets/use-forwarded.scss
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@use 'module_c' as *;
|
||||
|
||||
|
||||
.coated{
|
||||
@include color(green);
|
||||
@include surface(black);
|
||||
&-dark{
|
||||
@include surface(red);
|
||||
a{
|
||||
@include surface(blue);
|
||||
img{
|
||||
@include color(black);
|
||||
}
|
||||
}
|
||||
}
|
||||
span{
|
||||
@include color(green);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue