124 |
125 | This text is only for screen readers
126 |
127 |
128 | ```
129 |
130 | ## LICENSE
131 | [MIT](https://raw.githubusercontent.com/milad-alizadeh/vue-cli-plugin-scss-base/master/LICENSE)
132 |
--------------------------------------------------------------------------------
/generator/template/src/scss/mixins/__helpers.scss:
--------------------------------------------------------------------------------
1 | // Media Queries
2 | @mixin breakpoint($min-width: null, $min-height: null, $medium: screen) {
3 | @if ($min-width != null and $min-height != null) {
4 | @media #{$medium} and (min-width: $min-width) and (min-height: $min-height) {
5 | @content;
6 | }
7 | } @else
8 | if ($min-width != null and $min-height == null) {
9 | @media #{$medium} and (min-width: $min-width) {
10 | @content;
11 | }
12 | } @else
13 | if ($min-width == null and $min-height != null) {
14 | @media #{$medium} and (min-height: $min-height) {
15 | @content;
16 | }
17 | }
18 | }
19 |
20 | // Creating triangles
21 | @mixin triangle ($size, $color, $direction) {
22 | height: 0;
23 | width: 0;
24 | $width: nth($size, 1);
25 | $height: nth($size, length($size));
26 | $foreground-color: nth($color, 1);
27 | $background-color: if(length($color) == 2, nth($color, 2), transparent);
28 | @if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
29 | $width: $width / 2;
30 | $height: if(length($size) > 1, $height, $height/2);
31 | @if $direction == up {
32 | border-bottom: $height solid $foreground-color;
33 | border-left: $width solid $background-color;
34 | border-right: $width solid $background-color;
35 | } @else
36 | if $direction == right {
37 | border-bottom: $width solid $background-color;
38 | border-left: $height solid $foreground-color;
39 | border-top: $width solid $background-color;
40 | } @else
41 | if $direction == down {
42 | border-left: $width solid $background-color;
43 | border-right: $width solid $background-color;
44 | border-top: $height solid $foreground-color;
45 | } @else
46 | if $direction == left {
47 | border-bottom: $width solid $background-color;
48 | border-right: $height solid $foreground-color;
49 | border-top: $width solid $background-color;
50 | }
51 | } @else
52 | if ($direction == up-right) or ($direction == up-left) {
53 | border-top: $height solid $foreground-color;
54 | @if $direction == up-right {
55 | border-left: $width solid $background-color;
56 | } @else
57 | if $direction == up-left {
58 | border-right: $width solid $background-color;
59 | }
60 | } @else
61 | if ($direction == down-right) or ($direction == down-left) {
62 | border-bottom: $height solid $foreground-color;
63 | @if $direction == down-right {
64 | border-left: $width solid $background-color;
65 | } @else
66 | if $direction == down-left {
67 | border-right: $width solid $background-color;
68 | }
69 | } @else
70 | if ($direction == inset-up) {
71 | border-color: $background-color $background-color $foreground-color;
72 | border-style: solid;
73 | border-width: $height $width;
74 | } @else
75 | if ($direction == inset-down) {
76 | border-color: $foreground-color $background-color $background-color;
77 | border-style: solid;
78 | border-width: $height $width;
79 | } @else
80 | if ($direction == inset-right) {
81 | border-color: $background-color $background-color $background-color $foreground-color;
82 | border-style: solid;
83 | border-width: $width $height;
84 | } @else
85 | if ($direction == inset-left) {
86 | border-color: $background-color $foreground-color $background-color $background-color;
87 | border-style: solid;
88 | border-width: $width $height;
89 | }
90 | }
91 |
92 |
93 | // Breakpoint-loop
94 | // @include breakpoint-loop(width, (($medium, 80%), ($large, 50%)));
95 | @mixin breakpoint-loop($element, $properties) {
96 | @each $property in $properties {
97 | $size: nth($property, 1);
98 | $value: nth($property, 2);
99 |
100 | @include breakpoint($size) {
101 | #{$element}: $value;
102 | }
103 | }
104 | }
105 |
106 |
107 | // Full stretching an item the size of it's parent.
108 | // Remmeber that the parent can't have the position: static.
109 | // otherwise this mixin won't work
110 |
111 | @mixin full-absolute() {
112 | position: absolute;
113 | width: 100%;
114 | height: 100%;
115 | left: 0;
116 | top: 0;
117 | };
118 |
--------------------------------------------------------------------------------