tinywidgets 0.0.6 → 0.0.7
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/index.css.ts +1 -1
- package/media.ts +1 -1
- package/package.json +1 -1
- package/src/Ui/Header/SideNav/index.css.ts +5 -5
- package/src/Ui/index.css.ts +4 -4
- package/src/index.css.ts +35 -23
- package/src/index.ts +7 -4
package/index.css.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {accentHue, theme} from './src/index.css.ts';
|
package/media.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {large} from './src/index.ts';
|
|
1
|
+
export {large, small} from './src/index.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {style} from '@vanilla-extract/css';
|
|
2
|
+
import {dimensions, paddingLike, theme} from '../../../index.css.ts';
|
|
3
|
+
import {large} from '../../../index.ts';
|
|
4
4
|
|
|
5
5
|
export const sideNav = style([
|
|
6
6
|
paddingLike,
|
|
@@ -11,9 +11,9 @@ export const sideNav = style([
|
|
|
11
11
|
borderRight: `1px solid ${theme.border}`,
|
|
12
12
|
width: dimensions.sideNavWidth,
|
|
13
13
|
bottom: 0,
|
|
14
|
-
left:
|
|
14
|
+
left: dimensions.sideNavWidthHidden,
|
|
15
15
|
top: dimensions.topNavHeight,
|
|
16
|
-
height: `calc(
|
|
16
|
+
height: `calc(100dvh - ${dimensions.topNavHeight})`,
|
|
17
17
|
overscrollBehavior: 'contain',
|
|
18
18
|
transition: 'left .2s ease-in-out',
|
|
19
19
|
},
|
package/src/Ui/index.css.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {style} from '@vanilla-extract/css';
|
|
2
|
+
import {theme} from '../index.css.ts';
|
|
3
3
|
|
|
4
4
|
export const ui = style({
|
|
5
5
|
display: 'flex',
|
|
6
|
-
height: '
|
|
7
|
-
width: '
|
|
6
|
+
height: '100dvh',
|
|
7
|
+
width: '100dvw',
|
|
8
8
|
color: theme.foreground,
|
|
9
9
|
});
|
package/src/index.css.ts
CHANGED
|
@@ -6,12 +6,16 @@ import {
|
|
|
6
6
|
globalStyle,
|
|
7
7
|
style,
|
|
8
8
|
} from '@vanilla-extract/css';
|
|
9
|
+
import {small} from './';
|
|
9
10
|
|
|
10
|
-
export const
|
|
11
|
-
export const accentContrast = createVar();
|
|
11
|
+
export const accentHue = createVar();
|
|
12
12
|
|
|
13
13
|
export const theme = createThemeContract({
|
|
14
|
+
accentHue: null,
|
|
15
|
+
backgroundHue: null,
|
|
14
16
|
accent: null,
|
|
17
|
+
accentLight: null,
|
|
18
|
+
accentHover: null,
|
|
15
19
|
accentContrast: null,
|
|
16
20
|
underneath: null,
|
|
17
21
|
background: null,
|
|
@@ -22,37 +26,41 @@ export const theme = createThemeContract({
|
|
|
22
26
|
foreground2: null,
|
|
23
27
|
border: null,
|
|
24
28
|
shadow: null,
|
|
25
|
-
accentHover: null,
|
|
26
29
|
});
|
|
27
30
|
|
|
31
|
+
const themeCommon = {
|
|
32
|
+
accentHue: fallbackVar(accentHue, '8'),
|
|
33
|
+
backgroundHue: `calc(${theme.accentHue} + 180)`,
|
|
34
|
+
accent: `oklch(50% .11 ${theme.accentHue})`,
|
|
35
|
+
accentLight: `oklch(71% .16 ${theme.accentHue})`,
|
|
36
|
+
accentHover: `oklch(45% .1 ${theme.accentHue})`,
|
|
37
|
+
accentContrast: '#fff',
|
|
38
|
+
};
|
|
39
|
+
|
|
28
40
|
const light = {
|
|
29
|
-
|
|
30
|
-
accentContrast: fallbackVar(accentContrast, `#fff`),
|
|
41
|
+
...themeCommon,
|
|
31
42
|
underneath: '#fff',
|
|
32
|
-
background: `oklch(
|
|
33
|
-
background2: `oklch(
|
|
34
|
-
backgroundHaze: `oklch(
|
|
35
|
-
backgroundHover: `oklch(
|
|
36
|
-
foreground: `oklch(
|
|
37
|
-
foreground2: `oklch(
|
|
38
|
-
border: `oklch(
|
|
43
|
+
background: `oklch(99% .01 ${theme.backgroundHue})`,
|
|
44
|
+
background2: `oklch(95% .01 ${theme.backgroundHue})`,
|
|
45
|
+
backgroundHaze: `oklch(99% .01 ${theme.backgroundHue} / .5)`,
|
|
46
|
+
backgroundHover: `oklch(90% .01 ${theme.backgroundHue})`,
|
|
47
|
+
foreground: `oklch(30% .01 ${theme.accentHue})`,
|
|
48
|
+
foreground2: `oklch(50% .01 ${theme.accentHue})`,
|
|
49
|
+
border: `oklch(90% .01 ${theme.backgroundHue})`,
|
|
39
50
|
shadow: '0 1px 4px 0 hsl(0 0 20 / .1)',
|
|
40
|
-
accentHover: `oklch(from ${theme.accent} calc(l * 90%) c h)`,
|
|
41
51
|
};
|
|
42
52
|
|
|
43
53
|
const dark = {
|
|
44
|
-
|
|
45
|
-
accentContrast: fallbackVar(accentContrast, `#fff`),
|
|
54
|
+
...themeCommon,
|
|
46
55
|
underneath: '#000',
|
|
47
|
-
background: `oklch(
|
|
48
|
-
background2: `oklch(
|
|
49
|
-
backgroundHaze: `oklch(
|
|
50
|
-
backgroundHover: `oklch(
|
|
51
|
-
foreground: `oklch(
|
|
52
|
-
foreground2: `oklch(
|
|
53
|
-
border: `oklch(
|
|
56
|
+
background: `oklch(20% .01 ${theme.backgroundHue})`,
|
|
57
|
+
background2: `oklch(15% .01 ${theme.backgroundHue})`,
|
|
58
|
+
backgroundHaze: `oklch(21% 0% ${theme.backgroundHue} / .5)`,
|
|
59
|
+
backgroundHover: `oklch(25% .01 ${theme.backgroundHue})`,
|
|
60
|
+
foreground: `oklch(90% .01 ${theme.accentHue})`,
|
|
61
|
+
foreground2: `oklch(50% .01 ${theme.accentHue})`,
|
|
62
|
+
border: `oklch(30% .01 ${theme.backgroundHue})`,
|
|
54
63
|
shadow: '0 1px 4px 0 #000',
|
|
55
|
-
accentHover: `oklch(from ${theme.accent} calc(l * 90%) c h)`,
|
|
56
64
|
};
|
|
57
65
|
|
|
58
66
|
export const dimensions = {
|
|
@@ -60,6 +68,7 @@ export const dimensions = {
|
|
|
60
68
|
radius: '0.5rem',
|
|
61
69
|
titleWidth: '18rem',
|
|
62
70
|
sideNavWidth: '20rem',
|
|
71
|
+
sideNavWidthHidden: '-30rem',
|
|
63
72
|
topNavHeight: '4rem',
|
|
64
73
|
articleWidth: '60rem',
|
|
65
74
|
footerHeight: '10rem',
|
|
@@ -103,6 +112,9 @@ globalStyle('html', {
|
|
|
103
112
|
lineHeight: '1.5em',
|
|
104
113
|
textRendering: 'optimizeLegibility',
|
|
105
114
|
fontWeight: 400,
|
|
115
|
+
...small({
|
|
116
|
+
fontSize: '11px',
|
|
117
|
+
}),
|
|
106
118
|
});
|
|
107
119
|
|
|
108
120
|
globalStyle('h1', {fontSize: '1.5rem'});
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type {StyleRule} from '@vanilla-extract/css';
|
|
3
3
|
|
|
4
|
-
const LARGE = 'screen and (min-width:
|
|
4
|
+
const LARGE = 'screen and (min-width: 768px)';
|
|
5
|
+
const SMALL = 'screen and (max-width: 450px)';
|
|
5
6
|
|
|
6
7
|
export const {
|
|
7
8
|
createElement,
|
|
@@ -14,9 +15,11 @@ export const {
|
|
|
14
15
|
} = React;
|
|
15
16
|
|
|
16
17
|
export const large = (style: StyleRule) => ({
|
|
17
|
-
'@media': {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
'@media': {[LARGE]: style},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const small = (style: StyleRule) => ({
|
|
22
|
+
'@media': {[SMALL]: style},
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
export const classNames = (...classes: (string | boolean | undefined)[]) =>
|