@volverjs/style 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/components/vv-accordion-group.css +1 -1
  2. package/dist/components/vv-accordion.css +1 -1
  3. package/dist/components/vv-alert-group.css +1 -1
  4. package/dist/components/vv-alert.css +1 -1
  5. package/dist/components/vv-avatar-group.css +1 -1
  6. package/dist/components/vv-avatar.css +1 -1
  7. package/dist/components/vv-badge.css +1 -1
  8. package/dist/components/vv-breadcrumb.css +1 -1
  9. package/dist/components/vv-button-group.css +1 -1
  10. package/dist/components/vv-button.css +1 -1
  11. package/dist/components/vv-card.css +1 -1
  12. package/dist/components/vv-checkbox-group.css +1 -1
  13. package/dist/components/vv-checkbox.css +1 -1
  14. package/dist/components/vv-dialog.css +1 -1
  15. package/dist/components/vv-dropdown-action.css +1 -1
  16. package/dist/components/vv-dropdown-optgroup.css +1 -1
  17. package/dist/components/vv-dropdown-option.css +1 -1
  18. package/dist/components/vv-dropdown.css +1 -1
  19. package/dist/components/vv-input-file.css +1 -1
  20. package/dist/components/vv-input-text.css +1 -1
  21. package/dist/components/vv-nav.css +1 -1
  22. package/dist/components/vv-progress.css +1 -1
  23. package/dist/components/vv-radio-group.css +1 -1
  24. package/dist/components/vv-radio.css +1 -1
  25. package/dist/components/vv-select.css +1 -1
  26. package/dist/components/vv-skeleton.css +1 -1
  27. package/dist/components/vv-tab.css +1 -1
  28. package/dist/components/vv-table.css +1 -1
  29. package/dist/components/vv-text.css +1 -1
  30. package/dist/components/vv-textarea.css +1 -1
  31. package/dist/components/vv-tooltip.css +1 -1
  32. package/dist/components.css +1 -1
  33. package/dist/volver.css +1 -1
  34. package/package.json +2 -2
  35. package/src/tools/_breakpoints.scss +52 -8
  36. package/src/tools/_mixins.scss +3 -11
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "bugs": {
25
25
  "url": "https://github.com/volverjs/style/issues"
26
26
  },
27
- "version": "0.1.12",
27
+ "version": "0.1.13",
28
28
  "engines": {
29
29
  "node": ">= 12.x"
30
30
  },
@@ -48,7 +48,7 @@
48
48
  "markdown-it-prism": "^2.3.0",
49
49
  "postcss": "^8.4.47",
50
50
  "postcss-html": "^1.7.0",
51
- "postcss-preset-env": "^10.0.5",
51
+ "postcss-preset-env": "^10.0.6",
52
52
  "prettier": "^3.3.3",
53
53
  "prism-themes": "^1.9.0",
54
54
  "prismjs": "^1.29.0",
@@ -27,15 +27,23 @@
27
27
  );
28
28
  }
29
29
 
30
+ @function bp-next($name, $bps: $breakpoints, $bps-names: map.keys($bps)) {
31
+ @return breakpoint-next($name, $bps, $bps-names);
32
+ }
33
+
30
34
  // Minimum breakpoint width. Null for the smallest (first) breakpoint.
31
35
  // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
32
36
  // 576px
33
- @function breakpoint-min($name, $bps) {
37
+ @function breakpoint-min($name, $bps: $breakpoints) {
34
38
  $min: map.get($bps, $name);
35
39
 
36
40
  @return if($min != 0, $min, null);
37
41
  }
38
42
 
43
+ @function bp-min($name, $bps: $breakpoints) {
44
+ @return breakpoint-min($name, $bps);
45
+ }
46
+
39
47
  // Maximum breakpoint width. Null for the largest (last) breakpoint.
40
48
  // The maximum value is calculated as the minimum of the next one less 0.02px
41
49
  // to work around the limitations of `min-` and `max-` prefixes and viewports with fractional widths.
@@ -44,25 +52,33 @@
44
52
  // See https://bugs.webkit.org/show_bug.cgi?id=178261
45
53
  // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
46
54
  // 767.98px
47
- @function breakpoint-max($name, $bps) {
55
+ @function breakpoint-max($name, $bps: $breakpoints) {
48
56
  $next: breakpoint-next($name, $bps);
49
57
 
50
58
  @return if($next, breakpoint-min($next, $bps) - 0.02, null);
51
59
  }
52
60
 
61
+ @function bp-max($name, $bps: $breakpoints) {
62
+ @return breakpoint-max($name, $bps);
63
+ }
64
+
53
65
  // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
54
66
  // Useful for making responsive utilities.
55
67
  // >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
56
68
  // "" (Returns a blank string)
57
69
  // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
58
70
  // "-sm"
59
- @function breakpoint-infix($name, $bps) {
71
+ @function breakpoint-infix($name, $bps: $breakpoints) {
60
72
  @return if(breakpoint-min($name, $bps) == null, '', '-#{$name}');
61
73
  }
62
74
 
75
+ @function bp-infix($name, $bps: $breakpoints) {
76
+ @return breakpoint-infix($name, $bps);
77
+ }
78
+
63
79
  // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
64
80
  // Makes the @content apply to the given breakpoint and wider.
65
- @mixin media-breakpoint-up($name, $bps) {
81
+ @mixin media-breakpoint-up($name, $bps: $breakpoints) {
66
82
  $min: breakpoint-min($name, $bps);
67
83
 
68
84
  @if $min {
@@ -78,23 +94,39 @@
78
94
  }
79
95
  }
80
96
 
97
+ @mixin bp-up($name, $bps: $breakpoints) {
98
+ @include media-breakpoint-up($name, $bps) {
99
+ @content;
100
+ }
101
+ }
102
+
81
103
  // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
82
104
  // Makes the @content apply to the given breakpoint and narrower.
83
- @mixin media-breakpoint-down($name, $bps) {
105
+ @mixin media-breakpoint-down($name, $bps: $breakpoints) {
84
106
  $max: breakpoint-max($name, $bps);
85
107
 
86
108
  @if $max {
87
109
  @media (max-width: $max) {
88
- @content;
110
+ & {
111
+ @content;
112
+ }
89
113
  }
90
114
  } @else {
115
+ & {
116
+ @content;
117
+ }
118
+ }
119
+ }
120
+
121
+ @mixin bp-down($name, $bps: $breakpoints) {
122
+ @include media-breakpoint-down($name, $bps) {
91
123
  @content;
92
124
  }
93
125
  }
94
126
 
95
127
  // Media that spans multiple breakpoint widths.
96
128
  // Makes the @content apply between the min and max breakpoints
97
- @mixin media-breakpoint-between($lower, $upper, $bps) {
129
+ @mixin media-breakpoint-between($lower, $upper, $bps: $breakpoints) {
98
130
  $min: breakpoint-min($lower, $bps);
99
131
  $max: breakpoint-max($upper, $bps);
100
132
 
@@ -113,10 +145,16 @@
113
145
  }
114
146
  }
115
147
 
148
+ @mixin bp-between($lower, $upper, $bps: $breakpoints) {
149
+ @include media-breakpoint-between($lower, $upper, $bps) {
150
+ @content;
151
+ }
152
+ }
153
+
116
154
  // Media between the breakpoint's minimum and maximum widths.
117
155
  // No minimum for the smallest breakpoint, and no maximum for the largest one.
118
156
  // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
119
- @mixin media-breakpoint-only($name, $bps) {
157
+ @mixin media-breakpoint-only($name, $bps: $breakpoints) {
120
158
  $min: breakpoint-min($name, $bps);
121
159
  $max: breakpoint-max($name, $bps);
122
160
 
@@ -134,3 +172,9 @@
134
172
  }
135
173
  }
136
174
  }
175
+
176
+ @mixin bp-only($name, $bps: $breakpoints) {
177
+ @include media-breakpoint-only($name, $bps) {
178
+ @content;
179
+ }
180
+ }
@@ -978,15 +978,9 @@
978
978
  $prop-to-replace-with: #{$prop-to-replace-with}-#{$key};
979
979
 
980
980
  @if map.get($original, $key) {
981
- & {
982
- #{$prop-to-replace}: var(
983
- #{$prop-to-replace-with}
984
- );
985
- }
981
+ #{$prop-to-replace}: var(#{$prop-to-replace-with});
986
982
  } @else {
987
- & {
988
- #{$key}: var(#{$prop-to-replace-with});
989
- }
983
+ #{$key}: var(#{$prop-to-replace-with});
990
984
  }
991
985
  } @else {
992
986
  @if string.slice(meta.inspect($key), 1, 1) == '[' {
@@ -997,9 +991,7 @@
997
991
  );
998
992
  }
999
993
 
1000
- & {
1001
- #{$key}: $value;
1002
- }
994
+ #{$key}: $value;
1003
995
  }
1004
996
  }
1005
997
  }