@uxf/styles 1.5.0 → 2.0.0
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.
- package/README.md +153 -208
- package/color/shade.d.ts +2 -0
- package/color/shade.js +7 -0
- package/color/tint.d.ts +2 -0
- package/color/tint.js +7 -0
- package/mixins/sr-only.d.ts +2 -0
- package/mixins/sr-only.js +15 -0
- package/package.json +13 -23
- package/{utils/columnsToPercent.d.ts → properties/columns-to-percent.d.ts} +0 -0
- package/properties/columns-to-percent.js +11 -0
- package/properties/encoded-svg-url.d.ts +1 -0
- package/properties/encoded-svg-url.js +6 -0
- package/properties/repeat-grid-columns.d.ts +1 -0
- package/properties/repeat-grid-columns.js +10 -0
- package/{utils → properties}/transition.d.ts +0 -0
- package/properties/transition.js +15 -0
- package/responsive/match-between.d.ts +1 -0
- package/responsive/match-between.js +10 -0
- package/responsive/match-hidpi.d.ts +1 -0
- package/responsive/match-hidpi.js +10 -0
- package/responsive/match-max.d.ts +1 -0
- package/responsive/match-max.js +10 -0
- package/responsive/match-min.d.ts +1 -0
- package/responsive/match-min.js +10 -0
- package/responsive/mq-between.d.ts +1 -0
- package/responsive/mq-between.js +9 -0
- package/responsive/mq-hidpi.d.ts +1 -0
- package/responsive/mq-hidpi.js +22 -0
- package/responsive/mq-max.d.ts +1 -0
- package/responsive/mq-max.js +9 -0
- package/responsive/mq-min.d.ts +1 -0
- package/responsive/mq-min.js +9 -0
- package/types/index.d.ts +0 -108
- package/{utils → units}/em.d.ts +0 -0
- package/{utils → units}/em.js +1 -1
- package/units/format-css-value.d.ts +1 -0
- package/units/format-css-value.js +20 -0
- package/{utils → units}/percent.d.ts +0 -0
- package/{utils → units}/percent.js +1 -1
- package/{utils → units}/rem.d.ts +0 -0
- package/{utils → units}/rem.js +1 -1
- package/{utils → units}/spacing.d.ts +0 -0
- package/{utils → units}/spacing.js +1 -1
- package/{utils/withUnit.d.ts → units/with-unit.d.ts} +0 -0
- package/units/with-unit.js +6 -0
- package/components/AccesibleSvg/index.d.ts +0 -9
- package/components/AccesibleSvg/index.js +0 -64
- package/constants/index.d.ts +0 -15
- package/constants/index.js +0 -8
- package/mixins/appearanceReset.d.ts +0 -1
- package/mixins/appearanceReset.js +0 -11
- package/mixins/aspectRatio.d.ts +0 -2
- package/mixins/aspectRatio.js +0 -19
- package/mixins/injectCss.d.ts +0 -2
- package/mixins/injectCss.js +0 -17
- package/mixins/inputAutofill.d.ts +0 -2
- package/mixins/inputAutofill.js +0 -12
- package/mixins/inputReset.d.ts +0 -1
- package/mixins/inputReset.js +0 -12
- package/mixins/multilineTruncate.d.ts +0 -1
- package/mixins/multilineTruncate.js +0 -15
- package/mixins/noWrap.d.ts +0 -1
- package/mixins/noWrap.js +0 -11
- package/mixins/reboot.d.ts +0 -10
- package/mixins/reboot.js +0 -17
- package/mixins/responsiveHidden.d.ts +0 -2
- package/mixins/responsiveHidden.js +0 -17
- package/mixins/responsiveHideVisually.d.ts +0 -2
- package/mixins/responsiveHideVisually.js +0 -17
- package/mixins/responsiveMultilineTruncate.d.ts +0 -2
- package/mixins/responsiveMultilineTruncate.js +0 -8
- package/mixins/responsiveNoWrap.d.ts +0 -2
- package/mixins/responsiveNoWrap.js +0 -8
- package/mixins/responsiveTruncate.d.ts +0 -2
- package/mixins/responsiveTruncate.js +0 -18
- package/mixins/selectReset.d.ts +0 -2
- package/mixins/selectReset.js +0 -13
- package/mixins/textAreaReset.d.ts +0 -1
- package/mixins/textAreaReset.js +0 -12
- package/mixins/truncate.d.ts +0 -1
- package/mixins/truncate.js +0 -11
- package/properties/background.d.ts +0 -6
- package/properties/background.js +0 -14
- package/properties/borders.d.ts +0 -13
- package/properties/borders.js +0 -19
- package/properties/breaks.d.ts +0 -7
- package/properties/breaks.js +0 -15
- package/properties/character.d.ts +0 -12
- package/properties/character.js +0 -20
- package/properties/child.d.ts +0 -6
- package/properties/child.js +0 -19
- package/properties/colors.d.ts +0 -6
- package/properties/colors.js +0 -14
- package/properties/column.d.ts +0 -10
- package/properties/column.js +0 -18
- package/properties/display.d.ts +0 -5
- package/properties/display.js +0 -13
- package/properties/flexChild.d.ts +0 -9
- package/properties/flexChild.js +0 -17
- package/properties/flexParent.d.ts +0 -10
- package/properties/flexParent.js +0 -18
- package/properties/floating.d.ts +0 -6
- package/properties/floating.js +0 -14
- package/properties/gridChild.d.ts +0 -7
- package/properties/gridChild.js +0 -15
- package/properties/gridParent.d.ts +0 -20
- package/properties/gridParent.js +0 -31
- package/properties/interactions.d.ts +0 -8
- package/properties/interactions.js +0 -16
- package/properties/margins.d.ts +0 -10
- package/properties/margins.js +0 -16
- package/properties/maxLines.d.ts +0 -5
- package/properties/maxLines.js +0 -18
- package/properties/objectFitting.d.ts +0 -6
- package/properties/objectFitting.js +0 -14
- package/properties/overflow.d.ts +0 -7
- package/properties/overflow.js +0 -15
- package/properties/paddings.d.ts +0 -10
- package/properties/paddings.js +0 -16
- package/properties/paragraph.d.ts +0 -10
- package/properties/paragraph.js +0 -24
- package/properties/perspective.d.ts +0 -6
- package/properties/perspective.js +0 -14
- package/properties/position.d.ts +0 -11
- package/properties/position.js +0 -19
- package/properties/shadows.d.ts +0 -6
- package/properties/shadows.js +0 -14
- package/properties/sizing.d.ts +0 -10
- package/properties/sizing.js +0 -18
- package/properties/spacings.d.ts +0 -6
- package/properties/spacings.js +0 -14
- package/properties/textDecoration.d.ts +0 -5
- package/properties/textDecoration.js +0 -13
- package/properties/transform.d.ts +0 -7
- package/properties/transform.js +0 -15
- package/properties/transitions.d.ts +0 -10
- package/properties/transitions.js +0 -16
- package/properties/typography.d.ts +0 -7
- package/properties/typography.js +0 -16
- package/properties/visibility.d.ts +0 -8
- package/properties/visibility.js +0 -22
- package/utils/columnsToPercent.js +0 -11
- package/utils/encodedSvg.d.ts +0 -1
- package/utils/encodedSvg.js +0 -6
- package/utils/formatAspectRatio.d.ts +0 -3
- package/utils/formatAspectRatio.js +0 -22
- package/utils/formatGridColumns.d.ts +0 -2
- package/utils/formatGridColumns.js +0 -17
- package/utils/formatValue.d.ts +0 -3
- package/utils/formatValue.js +0 -36
- package/utils/getNumericValueFromArray.d.ts +0 -1
- package/utils/getNumericValueFromArray.js +0 -14
- package/utils/hiDPI.d.ts +0 -1
- package/utils/hiDPI.js +0 -21
- package/utils/nonEmptyStyle.d.ts +0 -2
- package/utils/nonEmptyStyle.js +0 -8
- package/utils/responsive.d.ts +0 -17
- package/utils/responsive.js +0 -89
- package/utils/responsiveMixin.d.ts +0 -3
- package/utils/responsiveMixin.js +0 -34
- package/utils/transition.js +0 -15
- package/utils/withUnit.js +0 -6
package/README.md
CHANGED
|
@@ -1,226 +1,171 @@
|
|
|
1
1
|
# @uxf/styles
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Color
|
|
4
4
|
|
|
5
|
-
### `
|
|
5
|
+
### `shade` and `tint`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- returns HEX string with mix of provided color and specified amount of black (`shade`) or white (`tint`)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
```ts
|
|
10
|
+
import { shade } from "@uxf/styles/colors/shade";
|
|
11
|
+
|
|
12
|
+
const darker = shade("#f00", 0.1);
|
|
13
|
+
```
|
|
14
|
+
```ts
|
|
15
|
+
import { tint } from "@uxf/styles/colors/tint";
|
|
16
|
+
|
|
17
|
+
const lighter = tint("#f00", 0.1);
|
|
18
|
+
```
|
|
11
19
|
|
|
12
20
|
## Mixins
|
|
13
21
|
|
|
14
|
-
### `
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### `responsiveHideVisually`
|
|
24
|
-
### `responsiveMultilineTruncate`
|
|
25
|
-
### `responsiveNoWrap`
|
|
26
|
-
### `responsiveTruncate`
|
|
27
|
-
### `selectReset`
|
|
28
|
-
### `textAreaReset`
|
|
29
|
-
### `truncate`
|
|
22
|
+
### `srOnly`
|
|
23
|
+
|
|
24
|
+
- returns js object with CSS to hide an element to all devices except screen readers
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { srOnly } from "@uxf/styles/mixins/sr-only";
|
|
28
|
+
|
|
29
|
+
const example = <div style={srOnly} />;
|
|
30
|
+
```
|
|
30
31
|
|
|
31
32
|
## Properties
|
|
32
33
|
|
|
33
|
-
### `
|
|
34
|
-
- `$backgroundColor`
|
|
35
|
-
- `$background`
|
|
36
|
-
### `borders`
|
|
37
|
-
- `$border`
|
|
38
|
-
- `$borderBottom`
|
|
39
|
-
- `$borderLeft`
|
|
40
|
-
- `$borderRight`
|
|
41
|
-
- `$borderTop`
|
|
42
|
-
- `$borderX`
|
|
43
|
-
- `$borderY`
|
|
44
|
-
- `$borderRadius`
|
|
45
|
-
- `$outline`
|
|
46
|
-
### `breaks`
|
|
47
|
-
- `$breakAfter`
|
|
48
|
-
- `$breakBefore`
|
|
49
|
-
- `$breakInside`
|
|
50
|
-
### `character`
|
|
51
|
-
- `$fontFamily`
|
|
52
|
-
- `$fontSize`
|
|
53
|
-
- `$fontStretch`
|
|
54
|
-
- `$fontStyle`
|
|
55
|
-
- `$fontWeight`
|
|
56
|
-
- `$letterSpacing`
|
|
57
|
-
- `$lineHeight`
|
|
58
|
-
- `$textTransform`
|
|
59
|
-
### `child`
|
|
60
|
-
- `$alignSelf`
|
|
61
|
-
- `$flexBasis`
|
|
62
|
-
- `$flexGrow`
|
|
63
|
-
- `$flexShrink`
|
|
64
|
-
- `$gridArea`
|
|
65
|
-
- `$justifySelf`
|
|
66
|
-
- `$order`
|
|
67
|
-
### `colors`
|
|
68
|
-
- `$backgroundColor`
|
|
69
|
-
- `$color`
|
|
70
|
-
### `column`
|
|
71
|
-
- `$columnCount`
|
|
72
|
-
- `$columnFill`
|
|
73
|
-
- `$columnGap`
|
|
74
|
-
- `$columnRule`
|
|
75
|
-
- `$columnSpan`
|
|
76
|
-
- `$columnWidth`
|
|
77
|
-
### `display`
|
|
78
|
-
- `$display`
|
|
79
|
-
### `flexChild`
|
|
80
|
-
- `$alignSelf`
|
|
81
|
-
- `$flexBasis`
|
|
82
|
-
- `$flexGrow`
|
|
83
|
-
- `$flexShrink`
|
|
84
|
-
- `$order`
|
|
85
|
-
### `flexParent`
|
|
86
|
-
- `$alignContent`
|
|
87
|
-
- `$alignItems`
|
|
88
|
-
- `$display`
|
|
89
|
-
- `$flexDirection`
|
|
90
|
-
- `$flexWrap`
|
|
91
|
-
- `$justifyContent`
|
|
92
|
-
### `floating`
|
|
93
|
-
- `$clear`
|
|
94
|
-
- `$float`
|
|
95
|
-
### `gridChild`
|
|
96
|
-
- `$alignSelf`
|
|
97
|
-
- `$gridArea`
|
|
98
|
-
- `$justifySelf`
|
|
99
|
-
### `gridParent`
|
|
100
|
-
- `$alignContent`
|
|
101
|
-
- `$alignItems`
|
|
102
|
-
- `$display`
|
|
103
|
-
- `$gridAutoColumns`
|
|
104
|
-
- `$gridAutoFlow`
|
|
105
|
-
- `$gridAutoRows`
|
|
106
|
-
- `$gridColumnCount`
|
|
107
|
-
- `$gridGap`
|
|
108
|
-
- `$gridColumnGap`
|
|
109
|
-
- `$gridRowGap`
|
|
110
|
-
- `$gridRowCount`
|
|
111
|
-
- `$gridTemplateAreas`
|
|
112
|
-
- `$gridTemplateColumns`
|
|
113
|
-
- `$gridTemplateRows`
|
|
114
|
-
- `$justifyContent`
|
|
115
|
-
- `$justifyItems`
|
|
116
|
-
### `interactions`
|
|
117
|
-
- `$cursor`
|
|
118
|
-
- `$pointerEvents`
|
|
119
|
-
- `$resize`
|
|
120
|
-
- `$userSelect`
|
|
121
|
-
### `margins`
|
|
122
|
-
- `$mb`
|
|
123
|
-
- `$ml`
|
|
124
|
-
- `$mr`
|
|
125
|
-
- `$mt`
|
|
126
|
-
- `$my`
|
|
127
|
-
- `$mx`
|
|
128
|
-
### `maxLines`
|
|
129
|
-
- `$maxLines`
|
|
130
|
-
### `objectFitting`
|
|
131
|
-
- `$objectFit`
|
|
132
|
-
- `$objectPosition`
|
|
133
|
-
### `overflow`
|
|
134
|
-
- `$overflow`
|
|
135
|
-
- `$overflowX`
|
|
136
|
-
- `$overflowY`
|
|
137
|
-
### `paddings`
|
|
138
|
-
- `$pb`
|
|
139
|
-
- `$pl`
|
|
140
|
-
- `$pr`
|
|
141
|
-
- `$pt`
|
|
142
|
-
- `$py`
|
|
143
|
-
- `$px`
|
|
144
|
-
### `paragraph`
|
|
145
|
-
- `$hyphens`
|
|
146
|
-
- `$maxLines`
|
|
147
|
-
- `$noWrap`
|
|
148
|
-
- `$textAlign`
|
|
149
|
-
- `$textIndent`
|
|
150
|
-
- `$truncate`
|
|
151
|
-
### `perspective`
|
|
152
|
-
- `$perspective`
|
|
153
|
-
- `$perspectiveOrigin`
|
|
154
|
-
### `position`
|
|
155
|
-
- `$bottom`
|
|
156
|
-
- `$left`
|
|
157
|
-
- `$right`
|
|
158
|
-
- `$top`
|
|
159
|
-
- `$position`
|
|
160
|
-
- `$verticalAlign`
|
|
161
|
-
- `$zIndex`
|
|
162
|
-
### `shadows`
|
|
163
|
-
- `$boxShadow`
|
|
164
|
-
- `$textShadow`
|
|
165
|
-
### `sizing`
|
|
166
|
-
- `$height`
|
|
167
|
-
- `$maxHeight`
|
|
168
|
-
- `$maxWidth`
|
|
169
|
-
- `$minHeight`
|
|
170
|
-
- `$minWidth`
|
|
171
|
-
- `$width`
|
|
172
|
-
### `spacings`
|
|
173
|
-
- `margins`
|
|
174
|
-
- `paddings`
|
|
175
|
-
### `textDecoration`
|
|
176
|
-
- `$textDecoration`
|
|
177
|
-
### `transform`
|
|
178
|
-
- `$transform`
|
|
179
|
-
- `$transformOrigin`
|
|
180
|
-
- `$transformStyle`
|
|
181
|
-
### `transitions`
|
|
182
|
-
- `$transition`
|
|
183
|
-
### `typography`
|
|
184
|
-
- `character`
|
|
185
|
-
- `colors`
|
|
186
|
-
- `paragraph`
|
|
187
|
-
- `textDecoration`
|
|
188
|
-
### `visibility`
|
|
189
|
-
- `$backfaceVisibility`
|
|
190
|
-
- `$hidden`
|
|
191
|
-
- `$opacity`
|
|
192
|
-
- `$hideVisually`
|
|
34
|
+
### `columnsToPercent`
|
|
193
35
|
|
|
194
|
-
|
|
36
|
+
- returns css `calc()` value with relative width of provided number of columns in provided total columns (defaults is `12`) compensated by optionally provided gutter in pixels
|
|
195
37
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
- several custom css property definitions (for these which are not suitable from `csstype` package)
|
|
199
|
-
- `ResponsiveProperty` namespace with typing for each property available in *Properties*
|
|
38
|
+
```tsx
|
|
39
|
+
import { columnsToPercent } from "@uxf/styles/properties/columns-to-percent";
|
|
200
40
|
|
|
201
|
-
|
|
41
|
+
const example = columnsToPercent(4, 12, 24);
|
|
42
|
+
/* returns "calc((100% + 1.5rem) / 12 * 4)" */
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### `encodedSvgUrl`
|
|
46
|
+
|
|
47
|
+
- returns css `url()` value of an encoded version of provided svg
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { encodedSvgUrl } from "@uxf/styles/properties/encoded-svg-url";
|
|
51
|
+
|
|
52
|
+
const example = encodedSvgUrl(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="0 20 20 0" /></svg>`);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### `repeatGridColumns`
|
|
56
|
+
|
|
57
|
+
- returns css `repeat()` value of provided number of columns and size
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { repeatGridColumns } from "@uxf/styles/properties/repeat-grid-columns";
|
|
61
|
+
|
|
62
|
+
const example = repeatGridColumns(6, "1fr"); /* returns "repeat(6, 1fr)" */
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `transition`
|
|
66
|
+
|
|
67
|
+
- returns css `transition` property for specified property or an array of properties
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { transition } from "@uxf/styles/properties/transition";
|
|
71
|
+
|
|
72
|
+
const example = transition(["color", "transform"], 400, "ease-in-out");
|
|
73
|
+
/* returns "color 400ms ease-in-out, transform 400 ease-in-out" */
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Responsive
|
|
77
|
+
|
|
78
|
+
### string media queries `mqBetween`, `mqHiDpi`, `mqMax`, `mqMin`
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { mqBetween } from "@uxf/styles/responsive/mq-between";
|
|
82
|
+
|
|
83
|
+
const example = mqBetween(320, 480)
|
|
84
|
+
/* returns "(min-width: 20em and (max-width: 29.9375em)" */
|
|
85
|
+
```
|
|
86
|
+
```tsx
|
|
87
|
+
import { mqHiDpi } from "@uxf/styles/responsive/mq-hidpi";
|
|
88
|
+
|
|
89
|
+
const example = mqHiDpi(3)
|
|
90
|
+
/* returns hidpi media query string for DPR 3.0 */
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `window.matchMedia().matches` media queries `matchBetween`, `matchHiDpi`, `matchMax`, `matchMin`
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import { matchBetween } from "@uxf/styles/responsive/match-between";
|
|
97
|
+
|
|
98
|
+
const example = matchBetween(320, 480) /* returns boolean */
|
|
99
|
+
```
|
|
100
|
+
```tsx
|
|
101
|
+
import { matchHiDpi } from "@uxf/styles/responsive/match-hidpi";
|
|
102
|
+
|
|
103
|
+
const example = matchHiDpi(3) /* returns boolean */
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Units
|
|
107
|
+
|
|
108
|
+
### `em` and `rem`
|
|
109
|
+
|
|
110
|
+
- returns string values divided by specified amount (defaults `16`)
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import { em } from "@uxf/styles/units/em";
|
|
114
|
+
|
|
115
|
+
const example1 = em(320) /* returns "20em" */
|
|
116
|
+
const example2 = em(320, 10) /* returns "32em" */
|
|
117
|
+
```
|
|
118
|
+
```tsx
|
|
119
|
+
import { rem } from "@uxf/styles/units/rem";
|
|
120
|
+
|
|
121
|
+
const example1 = rem(320) /* returns "20rem" */
|
|
122
|
+
const example2 = rem(320, 10) /* returns "32rem" */
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `formatCssValue`
|
|
126
|
+
|
|
127
|
+
- returns normalized css value: pass string as string or input to rem or zero as string or optionally forced input as string
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { formatCssValue } from "@uxf/styles/units/format-css-value";
|
|
131
|
+
|
|
132
|
+
const example1 = formatCssValue(0) /* returns "0" */
|
|
133
|
+
const example2 = formatCssValue(24) /* returns "1.5rem" */
|
|
134
|
+
const example3 = formatCssValue("100%") /* returns "100%" */
|
|
135
|
+
const example4 = formatCssValue(1, true) /* returns "1" */
|
|
136
|
+
```
|
|
202
137
|
|
|
203
|
-
### `columnsToPercent`
|
|
204
|
-
### `encodedSvg`
|
|
205
|
-
### `formatResponsiveAspectRatio`
|
|
206
|
-
### `formatResponsiveGridColumns`
|
|
207
|
-
### `formatValue`
|
|
208
|
-
### `formatResponsiveValue`
|
|
209
|
-
### `formatResponsiveValueFromProperty`
|
|
210
|
-
### `getNumericValueFromArray`
|
|
211
138
|
### `percent`
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
### `facepaintOnly`
|
|
222
|
-
### `resolveResponsiveProperties`
|
|
223
|
-
### `responsiveMixin`
|
|
139
|
+
|
|
140
|
+
- returns float of percentage of provided number in provided max value (defaults `100`) with provided precision (defaults `2`)
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
import { percent } from "@uxf/styles/units/percent";
|
|
144
|
+
|
|
145
|
+
const example = percent(54.874, 80, 2) /* returns 68.59 */
|
|
146
|
+
```
|
|
147
|
+
|
|
224
148
|
### `spacing`
|
|
225
|
-
|
|
149
|
+
|
|
150
|
+
- returns input multiplied by given factor (defaults `8`)
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { spacing } from "@uxf/styles/units/spacing";
|
|
154
|
+
|
|
155
|
+
const example = spacing(4) /* returns 32 */
|
|
156
|
+
|
|
157
|
+
```
|
|
226
158
|
### `withUnit`
|
|
159
|
+
|
|
160
|
+
- returns literal of input with CSS unit
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
import { withUnit } from "@uxf/styles/units/with-unit";
|
|
164
|
+
|
|
165
|
+
const example = withUnit(80, "vh") /* returns "80vh" */
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Types
|
|
169
|
+
|
|
170
|
+
- typed css units
|
|
171
|
+
- shared types for utils
|
package/color/shade.d.ts
ADDED
package/color/shade.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shade = void 0;
|
|
4
|
+
var tinycolor2_1 = require("tinycolor2");
|
|
5
|
+
var shade = function (color, amount) { return (0, tinycolor2_1.mix)(color, "#000", amount); };
|
|
6
|
+
exports.shade = shade;
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhZGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29sb3Ivc2hhZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUNBQTZDO0FBRXRDLElBQU0sS0FBSyxHQUFHLFVBQUMsS0FBaUIsRUFBRSxNQUFjLElBQUssT0FBQSxJQUFBLGdCQUFHLEVBQUMsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsRUFBMUIsQ0FBMEIsQ0FBQztBQUExRSxRQUFBLEtBQUssU0FBcUUifQ==
|
package/color/tint.d.ts
ADDED
package/color/tint.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tint = void 0;
|
|
4
|
+
var tinycolor2_1 = require("tinycolor2");
|
|
5
|
+
var tint = function (color, amount) { return (0, tinycolor2_1.mix)(color, "#fff", amount); };
|
|
6
|
+
exports.tint = tint;
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGludC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb2xvci90aW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHlDQUE2QztBQUV0QyxJQUFNLElBQUksR0FBRyxVQUFDLEtBQWlCLEVBQUUsTUFBYyxJQUFLLE9BQUEsSUFBQSxnQkFBRyxFQUFDLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxDQUFDLEVBQTFCLENBQTBCLENBQUM7QUFBekUsUUFBQSxJQUFJLFFBQXFFIn0=
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.srOnly = void 0;
|
|
4
|
+
exports.srOnly = {
|
|
5
|
+
borderWidth: "0",
|
|
6
|
+
clip: "rect(0, 0, 0, 0)",
|
|
7
|
+
height: "1px",
|
|
8
|
+
margin: "-1px",
|
|
9
|
+
overflow: "hidden",
|
|
10
|
+
padding: "0",
|
|
11
|
+
position: "absolute",
|
|
12
|
+
whiteSpace: "nowrap",
|
|
13
|
+
width: "1px",
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Itb25seS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9taXhpbnMvc3Itb25seS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFYSxRQUFBLE1BQU0sR0FBMkI7SUFDMUMsV0FBVyxFQUFFLEdBQUc7SUFDaEIsSUFBSSxFQUFFLGtCQUFrQjtJQUN4QixNQUFNLEVBQUUsS0FBSztJQUNiLE1BQU0sRUFBRSxNQUFNO0lBQ2QsUUFBUSxFQUFFLFFBQVE7SUFDbEIsT0FBTyxFQUFFLEdBQUc7SUFDWixRQUFRLEVBQUUsVUFBVTtJQUNwQixVQUFVLEVBQUUsUUFBUTtJQUNwQixLQUFLLEVBQUUsS0FBSztDQUNmLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/styles",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
"compile": "tsc -P tsconfig.build.json",
|
|
10
10
|
"dev": "parcel demo/index.html",
|
|
11
11
|
"lint:ts": "eslint -c .eslintrc.js \"./**/*.ts*\"",
|
|
12
|
-
"lint:css": "stylelint \"./**/*.(js|ts|tsx)\"",
|
|
13
12
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
14
|
-
"test": "npm run lint:ts && npm run
|
|
13
|
+
"test": "npm run lint:ts && npm run typecheck"
|
|
15
14
|
},
|
|
16
15
|
"publishConfig": {
|
|
17
16
|
"access": "public"
|
|
@@ -21,35 +20,26 @@
|
|
|
21
20
|
"url": "git+https://gitlab.com/uxf-npm/styles.git"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@types/facepaint": "^1.2.2",
|
|
23
|
+
"@types/node": "^18.8.2",
|
|
26
24
|
"@types/react": "^17.0.2",
|
|
27
25
|
"@types/react-dom": "^17.0.2",
|
|
28
|
-
"@types/
|
|
29
|
-
"@uxf/core": "^
|
|
26
|
+
"@types/tinycolor2": "^1.4.3",
|
|
27
|
+
"@uxf/core": "^3.1.0",
|
|
30
28
|
"@uxf/eslint-config": "^1.2.3",
|
|
31
|
-
"csstype": "^3.
|
|
32
|
-
"eslint": "^8.
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"postcss": "^8.4.12",
|
|
36
|
-
"postcss-syntax": "^0.36.2",
|
|
37
|
-
"prettier": "^2.6.1",
|
|
29
|
+
"csstype": "^3.1.1",
|
|
30
|
+
"eslint": "^8.8.0",
|
|
31
|
+
"parcel": "^2.7.0",
|
|
32
|
+
"prettier": "^2.7.1",
|
|
38
33
|
"react": "^17.0.2",
|
|
39
34
|
"react-dom": "^17.0.2",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"stylelint-config-recommended": "^7.0.0",
|
|
43
|
-
"stylelint-config-styled-components": "^0.1.1",
|
|
44
|
-
"stylelint-processor-styled-components": "^1.10.0",
|
|
45
|
-
"typescript": "^4.5.4"
|
|
35
|
+
"tinycolor2": "^1.4.2",
|
|
36
|
+
"typescript": "^4.8.4"
|
|
46
37
|
},
|
|
47
38
|
"peerDependencies": {
|
|
48
|
-
"@uxf/core": "^
|
|
49
|
-
"facepaint": "^1.2.1",
|
|
39
|
+
"@uxf/core": "^3.1.0",
|
|
50
40
|
"react": "^16 || ^17 || ^18",
|
|
51
41
|
"react-dom": "^16 || ^17 || ^18",
|
|
52
|
-
"
|
|
42
|
+
"tinycolor2": "^1.4.2"
|
|
53
43
|
},
|
|
54
44
|
"author": "",
|
|
55
45
|
"license": "ISC",
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.columnsToPercent = void 0;
|
|
4
|
+
var format_css_value_1 = require("../units/format-css-value");
|
|
5
|
+
var columnsToPercent = function (columns, totalColumns, gutter) {
|
|
6
|
+
if (totalColumns === void 0) { totalColumns = 12; }
|
|
7
|
+
if (gutter === void 0) { gutter = 0; }
|
|
8
|
+
return "calc(".concat(gutter !== 0 ? "(100% + ".concat((0, format_css_value_1.formatCssValue)(gutter), ")") : "100%", " / ").concat(totalColumns, " * ").concat(columns, ")");
|
|
9
|
+
};
|
|
10
|
+
exports.columnsToPercent = columnsToPercent;
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sdW1ucy10by1wZXJjZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Byb3BlcnRpZXMvY29sdW1ucy10by1wZXJjZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDhEQUEyRDtBQUVwRCxJQUFNLGdCQUFnQixHQUFHLFVBQUMsT0FBZSxFQUFFLFlBQWlCLEVBQUUsTUFBVTtJQUE3Qiw2QkFBQSxFQUFBLGlCQUFpQjtJQUFFLHVCQUFBLEVBQUEsVUFBVTtJQUMzRSxPQUFBLGVBQVEsTUFBTSxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsa0JBQVcsSUFBQSxpQ0FBYyxFQUFDLE1BQU0sQ0FBQyxNQUFHLENBQUMsQ0FBQyxDQUFDLE1BQU0sZ0JBQU0sWUFBWSxnQkFBTSxPQUFPLE1BQUc7QUFBdEcsQ0FBc0csQ0FBQztBQUQ5RixRQUFBLGdCQUFnQixvQkFDOEUifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const encodedSvgUrl: (svg: string) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encodedSvgUrl = void 0;
|
|
4
|
+
var encodedSvgUrl = function (svg) { return "url(\"data:image/svg+xml; utf8, ".concat(escape(svg), "\")"); };
|
|
5
|
+
exports.encodedSvgUrl = encodedSvgUrl;
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RlZC1zdmctdXJsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Byb3BlcnRpZXMvZW5jb2RlZC1zdmctdXJsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFPLElBQU0sYUFBYSxHQUFHLFVBQUMsR0FBVyxJQUFLLE9BQUEsMENBQWtDLE1BQU0sQ0FBQyxHQUFHLENBQUMsUUFBSSxFQUFqRCxDQUFpRCxDQUFDO0FBQW5GLFFBQUEsYUFBYSxpQkFBc0UifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const repeatGridColumns: (count?: number, size?: string) => string | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.repeatGridColumns = void 0;
|
|
4
|
+
var format_css_value_1 = require("../units/format-css-value");
|
|
5
|
+
var repeatGridColumns = function (count, size) {
|
|
6
|
+
if (size === void 0) { size = "1fr"; }
|
|
7
|
+
return count && size ? "repeat(".concat(count, ", ").concat((0, format_css_value_1.formatCssValue)(size), ")") : null;
|
|
8
|
+
};
|
|
9
|
+
exports.repeatGridColumns = repeatGridColumns;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwZWF0LWdyaWQtY29sdW1ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcm9wZXJ0aWVzL3JlcGVhdC1ncmlkLWNvbHVtbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsOERBQTJEO0FBRXBELElBQU0saUJBQWlCLEdBQUcsVUFBQyxLQUFjLEVBQUUsSUFBWTtJQUFaLHFCQUFBLEVBQUEsWUFBWTtJQUMxRCxPQUFBLEtBQUssSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDLGlCQUFVLEtBQUssZUFBSyxJQUFBLGlDQUFjLEVBQUMsSUFBSSxDQUFDLE1BQUcsQ0FBQyxDQUFDLENBQUMsSUFBSTtBQUFsRSxDQUFrRSxDQUFDO0FBRDFELFFBQUEsaUJBQWlCLHFCQUN5QyJ9
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transition = void 0;
|
|
4
|
+
var camelCaseToDash_1 = require("@uxf/core/utils/camelCaseToDash");
|
|
5
|
+
var with_unit_1 = require("../units/with-unit");
|
|
6
|
+
var transition = function (property, duration, easing) {
|
|
7
|
+
if (duration === void 0) { duration = 400; }
|
|
8
|
+
if (easing === void 0) { easing = "ease-in-out"; }
|
|
9
|
+
if (Array.isArray(property)) {
|
|
10
|
+
return property.map(function (p) { return (0, exports.transition)(p, duration, easing); }).join(", ");
|
|
11
|
+
}
|
|
12
|
+
return "".concat((0, camelCaseToDash_1.camelCaseToDash)(property), " ").concat((0, with_unit_1.withUnit)(duration, "ms"), " ").concat(easing);
|
|
13
|
+
};
|
|
14
|
+
exports.transition = transition;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNpdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcm9wZXJ0aWVzL3RyYW5zaXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbUVBQWtFO0FBR2xFLGdEQUE4QztBQUV2QyxJQUFNLFVBQVUsR0FBRyxVQUN0QixRQUE4QixFQUM5QixRQUFjLEVBQ2QsTUFBeUQ7SUFEekQseUJBQUEsRUFBQSxjQUFjO0lBQ2QsdUJBQUEsRUFBQSxzQkFBeUQ7SUFFekQsSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxFQUFFO1FBQ3pCLE9BQU8sUUFBUSxDQUFDLEdBQUcsQ0FBQyxVQUFDLENBQUMsSUFBSyxPQUFBLElBQUEsa0JBQVUsRUFBQyxDQUFDLEVBQUUsUUFBUSxFQUFFLE1BQU0sQ0FBQyxFQUEvQixDQUErQixDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzFFO0lBQ0QsT0FBTyxVQUFHLElBQUEsaUNBQWUsRUFBQyxRQUFRLENBQUMsY0FBSSxJQUFBLG9CQUFRLEVBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxjQUFJLE1BQU0sQ0FBRSxDQUFDO0FBQ2hGLENBQUMsQ0FBQztBQVRXLFFBQUEsVUFBVSxjQVNyQiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function matchBetween(from: number, to: number): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchBetween = void 0;
|
|
4
|
+
var isBrowser_1 = require("@uxf/core/utils/isBrowser");
|
|
5
|
+
var mq_between_1 = require("./mq-between");
|
|
6
|
+
function matchBetween(from, to) {
|
|
7
|
+
return isBrowser_1.isBrowser ? window.matchMedia((0, mq_between_1.mqBetween)(from, to)).matches : false;
|
|
8
|
+
}
|
|
9
|
+
exports.matchBetween = matchBetween;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0Y2gtYmV0d2Vlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXNwb25zaXZlL21hdGNoLWJldHdlZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdURBQXNEO0FBQ3RELDJDQUF5QztBQUV6QyxTQUFnQixZQUFZLENBQUMsSUFBWSxFQUFFLEVBQVU7SUFDakQsT0FBTyxxQkFBUyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLElBQUEsc0JBQVMsRUFBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQztBQUM5RSxDQUFDO0FBRkQsb0NBRUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function matchHidpi(ratio: number): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchHidpi = void 0;
|
|
4
|
+
var isBrowser_1 = require("@uxf/core/utils/isBrowser");
|
|
5
|
+
var mq_hidpi_1 = require("./mq-hidpi");
|
|
6
|
+
function matchHidpi(ratio) {
|
|
7
|
+
return isBrowser_1.isBrowser ? window.matchMedia((0, mq_hidpi_1.mqHiDpi)(ratio)).matches : false;
|
|
8
|
+
}
|
|
9
|
+
exports.matchHidpi = matchHidpi;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0Y2gtaGlkcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmVzcG9uc2l2ZS9tYXRjaC1oaWRwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx1REFBc0Q7QUFDdEQsdUNBQXFDO0FBRXJDLFNBQWdCLFVBQVUsQ0FBQyxLQUFhO0lBQ3BDLE9BQU8scUJBQVMsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxJQUFBLGtCQUFPLEVBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQztBQUN6RSxDQUFDO0FBRkQsZ0NBRUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function matchMax(to: number): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchMax = void 0;
|
|
4
|
+
var isBrowser_1 = require("@uxf/core/utils/isBrowser");
|
|
5
|
+
var mq_max_1 = require("./mq-max");
|
|
6
|
+
function matchMax(to) {
|
|
7
|
+
return isBrowser_1.isBrowser ? window.matchMedia((0, mq_max_1.mqMax)(to)).matches : false;
|
|
8
|
+
}
|
|
9
|
+
exports.matchMax = matchMax;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0Y2gtbWF4LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Jlc3BvbnNpdmUvbWF0Y2gtbWF4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHVEQUFzRDtBQUN0RCxtQ0FBaUM7QUFFakMsU0FBZ0IsUUFBUSxDQUFDLEVBQVU7SUFDL0IsT0FBTyxxQkFBUyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLElBQUEsY0FBSyxFQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUM7QUFDcEUsQ0FBQztBQUZELDRCQUVDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function matchMin(from: number): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchMin = void 0;
|
|
4
|
+
var isBrowser_1 = require("@uxf/core/utils/isBrowser");
|
|
5
|
+
var mq_min_1 = require("./mq-min");
|
|
6
|
+
function matchMin(from) {
|
|
7
|
+
return isBrowser_1.isBrowser ? window.matchMedia((0, mq_min_1.mqMin)(from)).matches : false;
|
|
8
|
+
}
|
|
9
|
+
exports.matchMin = matchMin;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0Y2gtbWluLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Jlc3BvbnNpdmUvbWF0Y2gtbWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHVEQUFzRDtBQUN0RCxtQ0FBaUM7QUFFakMsU0FBZ0IsUUFBUSxDQUFDLElBQVk7SUFDakMsT0FBTyxxQkFBUyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLElBQUEsY0FBSyxFQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUM7QUFDdEUsQ0FBQztBQUZELDRCQUVDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mqBetween(from: number, to: number): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mqBetween = void 0;
|
|
4
|
+
var em_1 = require("../units/em");
|
|
5
|
+
function mqBetween(from, to) {
|
|
6
|
+
return "(min-width: ".concat((0, em_1.em)(from), ") and (max-width: ").concat((0, em_1.em)(to - 1), ")");
|
|
7
|
+
}
|
|
8
|
+
exports.mqBetween = mqBetween;
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXEtYmV0d2Vlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXNwb25zaXZlL21xLWJldHdlZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0NBQWlDO0FBRWpDLFNBQWdCLFNBQVMsQ0FBQyxJQUFZLEVBQUUsRUFBVTtJQUM5QyxPQUFPLHNCQUFlLElBQUEsT0FBRSxFQUFDLElBQUksQ0FBQywrQkFBcUIsSUFBQSxPQUFFLEVBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQyxNQUFHLENBQUM7QUFDckUsQ0FBQztBQUZELDhCQUVDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mqHiDpi(ratio?: number): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mqHiDpi = void 0;
|
|
4
|
+
function mqHiDpi(ratio) {
|
|
5
|
+
if (ratio === void 0) { ratio = 2; }
|
|
6
|
+
if (ratio < 1) {
|
|
7
|
+
ratio = 1;
|
|
8
|
+
}
|
|
9
|
+
return ("\n only screen and (-webkit-min-device-pixel-ratio: " +
|
|
10
|
+
ratio +
|
|
11
|
+
"),\n only screen and (min--moz-device-pixel-ratio: " +
|
|
12
|
+
ratio +
|
|
13
|
+
"),\n only screen and (-o-min-device-pixel-ratio: " +
|
|
14
|
+
ratio +
|
|
15
|
+
"/1),\n only screen and (min-resolution: " +
|
|
16
|
+
Math.round(ratio * 96) +
|
|
17
|
+
"dpi),\n only screen and (min-resolution: " +
|
|
18
|
+
ratio +
|
|
19
|
+
"dppx)\n ");
|
|
20
|
+
}
|
|
21
|
+
exports.mqHiDpi = mqHiDpi;
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXEtaGlkcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmVzcG9uc2l2ZS9tcS1oaWRwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxTQUFnQixPQUFPLENBQUMsS0FBUztJQUFULHNCQUFBLEVBQUEsU0FBUztJQUM3QixJQUFJLEtBQUssR0FBRyxDQUFDLEVBQUU7UUFDWCxLQUFLLEdBQUcsQ0FBQyxDQUFDO0tBQ2I7SUFFRCxPQUFPLENBQ0gseURBQXlEO1FBQ3pELEtBQUs7UUFDTCx3REFBd0Q7UUFDeEQsS0FBSztRQUNMLHNEQUFzRDtRQUN0RCxLQUFLO1FBQ0wsNkNBQTZDO1FBQzdDLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxHQUFHLEVBQUUsQ0FBQztRQUN0Qiw4Q0FBOEM7UUFDOUMsS0FBSztRQUNMLFdBQVcsQ0FDZCxDQUFDO0FBQ04sQ0FBQztBQWxCRCwwQkFrQkMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mqMax(to: number): string;
|