forked from amcss/amcss.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_mixins.scss
More file actions
53 lines (49 loc) · 1.06 KB
/
_mixins.scss
File metadata and controls
53 lines (49 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$attr: false;
@mixin attr() {
// @if $attr {
// [#{$prefix}#{$attr}] {
// @content;
// }
// }
// @else {
// @warn "attr() needs to be called within an AM block";
// }
}
@mixin val($value) {
// @if $attr {
// [#{$prefix}#{$attr}~="#{$value}"] {
// @content;
// }
//
// @each $bp in $breakpoints {
// .breakpoint-#{$bp} [#{$prefix}#{$attr}~="#{$bp}:#{$value}"] {
// @extend [#{$prefix}#{$attr}~="#{$value}"];
// }
// }
// }
// @else {
// @warn "attr() needs to be called within an AM block";
// }
}
@mixin AM($local-attr) {
$attr: $local-attr;
@content;
$attr: false;
}
@mixin trait($attr, $value: "") {
@extend [#{$prefix}#{$attr}];
$string: $value;
$continue: true;
@while $continue {
$next-space: str-index($string, ' ');
@if type-of($next-space) == number {
$next-word: str-slice($string, 1, $next-space - 1);
$string: str-slice($string, $next-space + 1);
}
@else {
$next-word: $string;
$continue: false;
}
@extend [#{$prefix}#{$attr}~="#{$next-word}"];
}
}