File tree 2 files changed +36
-4
lines changed
packages/web/src/scss/tools
2 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 67
67
$properties : (
68
68
' justify-content' ,
69
69
' justify-items' ,
70
- ),
71
- $infix : ' tablet--'
70
+ )
72
71
);
73
72
}
74
73
75
74
@include test .expect () {
76
- .Test--tablet-- alignmentXStretch {
75
+ .Test--alignmentXStretch {
77
76
justify-content : stretch ;
78
77
justify-items : stretch ;
79
78
}
80
79
}
81
80
}
81
+
82
+ @include test .assert () {
83
+ @include test .output () {
84
+ @include dictionaries .generate-alignments (
85
+ $class-name : ' Test' ,
86
+ $dictionary-values : (
87
+ ' space-between' ,
88
+ ),
89
+ $axis : ' x' ,
90
+ $properties : (
91
+ ' justify-content' ,
92
+ ' justify-items' ,
93
+ )
94
+ );
95
+ }
96
+
97
+ @include test .expect () {
98
+ .Test--alignmentXSpaceBetween {
99
+ justify-content : space-between ;
100
+ }
101
+ }
102
+ }
82
103
}
83
104
}
84
105
Original file line number Diff line number Diff line change 24
24
}
25
25
26
26
// Mixin to generate alignment classes based on a dictionary
27
+ // Invalid property-value pairs are filtered out from the generated classes.
27
28
// Parameters are:
28
29
// * $class-name: the name of the component class to generate
29
30
// * $dictionary-values: map of the dictionary values to generate
39
40
' align-items' ,
40
41
),
41
42
);
43
+ $invalid-property-value-map : (
44
+ ' justify-items' : ' space-between' ,
45
+ );
42
46
43
47
@if $properties {
44
48
$axis-properties : map .set ($axis-properties , $axis , $properties );
47
51
@each $alignment in $dictionary-values {
48
52
.#{$class-name } --#{$infix }#{spirit- string .convert-kebab-case-to-camel-case (alignment- #{$axis } - #{$alignment } )} {
49
53
@each $property in map .get ($axis-properties , $axis ) {
50
- #{$property } : string .unquote (alignment .translate-physical-to-logical ($alignment ));
54
+ @if not (
55
+ map .has-key ($invalid-property-value-map , $property ) and
56
+ map .get ($invalid-property-value-map , $property ) ==
57
+ $alignment
58
+ )
59
+ {
60
+ #{$property } : string .unquote (alignment .translate-physical-to-logical ($alignment ));
61
+ }
51
62
}
52
63
}
53
64
}
You can’t perform that action at this time.
0 commit comments