@inc2734/unitone-css 0.23.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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/dist/app.css +1 -0
  4. package/dist/app.js +1 -0
  5. package/dist/storybook.css +1 -0
  6. package/package.json +60 -0
  7. package/src/.DS_Store +0 -0
  8. package/src/app.js +21 -0
  9. package/src/app.scss +8 -0
  10. package/src/foundation/_foundation.scss +108 -0
  11. package/src/helper/_align-items.scss +7 -0
  12. package/src/helper/_align-self.scss +17 -0
  13. package/src/helper/_align.scss +14 -0
  14. package/src/helper/_fluid-typography.scss +7 -0
  15. package/src/helper/_gap.scss +7 -0
  16. package/src/helper/_gutters.scss +7 -0
  17. package/src/helper/_helper.scss +21 -0
  18. package/src/helper/_justify-content.scss +7 -0
  19. package/src/helper/_justify-self.scss +17 -0
  20. package/src/helper/_padding.scss +7 -0
  21. package/src/layout-primitives/_layout-primitives.scss +33 -0
  22. package/src/layout-primitives/both-sides/BothSides.jsx +22 -0
  23. package/src/layout-primitives/both-sides/README.md +54 -0
  24. package/src/layout-primitives/both-sides/_both-sides.scss +24 -0
  25. package/src/layout-primitives/both-sides/stories/index.jsx +51 -0
  26. package/src/layout-primitives/center/Center.jsx +18 -0
  27. package/src/layout-primitives/center/README.md +33 -0
  28. package/src/layout-primitives/center/_center.scss +17 -0
  29. package/src/layout-primitives/center/stories/index.jsx +39 -0
  30. package/src/layout-primitives/cluster/Cluster.jsx +21 -0
  31. package/src/layout-primitives/cluster/README.md +35 -0
  32. package/src/layout-primitives/cluster/_cluster.scss +22 -0
  33. package/src/layout-primitives/cluster/stories/index.jsx +79 -0
  34. package/src/layout-primitives/container/Container.jsx +23 -0
  35. package/src/layout-primitives/container/README.md +39 -0
  36. package/src/layout-primitives/container/_container.scss +18 -0
  37. package/src/layout-primitives/container/stories/index.jsx +65 -0
  38. package/src/layout-primitives/cover/Cover.jsx +30 -0
  39. package/src/layout-primitives/cover/README.md +54 -0
  40. package/src/layout-primitives/cover/_cover.scss +37 -0
  41. package/src/layout-primitives/cover/stories/index.jsx +140 -0
  42. package/src/layout-primitives/decorator/Decorator.jsx +49 -0
  43. package/src/layout-primitives/decorator/README.md +49 -0
  44. package/src/layout-primitives/decorator/_decorator.scss +54 -0
  45. package/src/layout-primitives/decorator/stories/index.jsx +190 -0
  46. package/src/layout-primitives/float/Float.jsx +24 -0
  47. package/src/layout-primitives/float/README.md +24 -0
  48. package/src/layout-primitives/float/_float.scss +29 -0
  49. package/src/layout-primitives/float/stories/index.jsx +78 -0
  50. package/src/layout-primitives/frame/Frame.jsx +19 -0
  51. package/src/layout-primitives/frame/README.md +7 -0
  52. package/src/layout-primitives/frame/_frame.scss +45 -0
  53. package/src/layout-primitives/frame/stories/index.jsx +50 -0
  54. package/src/layout-primitives/gutters/Gutters.jsx +17 -0
  55. package/src/layout-primitives/gutters/README.md +23 -0
  56. package/src/layout-primitives/gutters/_gutters.scss +12 -0
  57. package/src/layout-primitives/gutters/stories/index.jsx +48 -0
  58. package/src/layout-primitives/layers/Layers.jsx +18 -0
  59. package/src/layout-primitives/layers/README.md +32 -0
  60. package/src/layout-primitives/layers/_layers.scss +51 -0
  61. package/src/layout-primitives/layers/stories/index.jsx +133 -0
  62. package/src/layout-primitives/responsive-grid/README.md +11 -0
  63. package/src/layout-primitives/responsive-grid/ResponsiveGrid.jsx +22 -0
  64. package/src/layout-primitives/responsive-grid/_responsive-grid.scss +14 -0
  65. package/src/layout-primitives/responsive-grid/stories/index.jsx +65 -0
  66. package/src/layout-primitives/stack/README.md +24 -0
  67. package/src/layout-primitives/stack/Stack.jsx +22 -0
  68. package/src/layout-primitives/stack/_stack.scss +31 -0
  69. package/src/layout-primitives/stack/stories/index.jsx +123 -0
  70. package/src/layout-primitives/switcher/README.md +17 -0
  71. package/src/layout-primitives/switcher/Switcher.jsx +19 -0
  72. package/src/layout-primitives/switcher/_switcher.scss +19 -0
  73. package/src/layout-primitives/switcher/stories/index.jsx +50 -0
  74. package/src/layout-primitives/text/README.md +16 -0
  75. package/src/layout-primitives/text/Text.jsx +19 -0
  76. package/src/layout-primitives/text/_text.scss +80 -0
  77. package/src/layout-primitives/text/stories/index.jsx +112 -0
  78. package/src/layout-primitives/with-sidebar/README.md +36 -0
  79. package/src/layout-primitives/with-sidebar/WithSidebar.jsx +35 -0
  80. package/src/layout-primitives/with-sidebar/_with-sidebar.scss +58 -0
  81. package/src/layout-primitives/with-sidebar/stories/index.jsx +127 -0
  82. package/src/patterns/features/features-1/Features1.jsx +52 -0
  83. package/src/patterns/features/features-1/stories/index.jsx +68 -0
  84. package/src/patterns/features/features-2/Features2.jsx +33 -0
  85. package/src/patterns/features/features-2/stories/index.jsx +67 -0
  86. package/src/patterns/header/header-1/Header1.jsx +31 -0
  87. package/src/patterns/header/header-1/stories/index.jsx +44 -0
  88. package/src/patterns/header/header-2/Header2.jsx +33 -0
  89. package/src/patterns/header/header-2/stories/index.jsx +44 -0
  90. package/src/patterns/header/header-3/Header3.jsx +30 -0
  91. package/src/patterns/header/header-3/stories/index.jsx +43 -0
  92. package/src/patterns/header/header-4/Header4.jsx +25 -0
  93. package/src/patterns/header/header-4/stories/index.jsx +41 -0
  94. package/src/patterns/header/header-5/Header5.jsx +32 -0
  95. package/src/patterns/header/header-5/stories/index.jsx +43 -0
  96. package/src/patterns/header/header-6/Header6.jsx +34 -0
  97. package/src/patterns/header/header-6/stories/index.jsx +58 -0
  98. package/src/patterns/media-text/media-text-1/MediaText1.jsx +41 -0
  99. package/src/patterns/media-text/media-text-1/stories/index.jsx +34 -0
  100. package/src/patterns/media-text/media-text-2/MediaText2.jsx +39 -0
  101. package/src/patterns/media-text/media-text-2/stories/index.jsx +34 -0
  102. package/src/settings/_body.scss +8 -0
  103. package/src/settings/_html.scss +3 -0
  104. package/src/settings/_root.scss +152 -0
  105. package/src/settings/_settings.scss +3 -0
  106. package/src/stories/1.introduction.stories.mdx +27 -0
  107. package/src/stories/2.get-started.stories.mdx +23 -0
  108. package/src/stories/3.global-api.stories.mdx +57 -0
  109. package/src/storybook.scss +11 -0
  110. package/src/variables/_variables.scss +22 -0
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+
3
+ import { Header5 } from '../Header5';
4
+
5
+ export default {
6
+ title: 'Patterns/Header/Header-5',
7
+ component: Header5,
8
+ argTypes: {
9
+ backgroundColor: {
10
+ control: { type: 'color' },
11
+ table: { defaultValue: { summary: 'transparent' } },
12
+ type: { name: 'string', required: false },
13
+ },
14
+ color: {
15
+ control: { type: 'color' },
16
+ table: { defaultValue: { summary: 'initial' } },
17
+ type: { name: 'string', required: false },
18
+ },
19
+ },
20
+ args: {
21
+ backgroundColor: 'transparent',
22
+ color: 'initial',
23
+ },
24
+ parameters: {
25
+ layout: 'fullscreen',
26
+ },
27
+ };
28
+
29
+ export const Default = (props) => (
30
+ <Header5
31
+ src="https://placehold.jp/1280x1024.jpg"
32
+ title="Lorem ipsum dolor sit amet, consectetur adipisicing elit"
33
+ backgroundColor={props.backgroundColor}
34
+ color={props.color}
35
+ >
36
+ <p>
37
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
38
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
39
+ laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
40
+ voluptate velit esse cill
41
+ </p>
42
+ </Header5>
43
+ );
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ import { Decorator } from '../../../layout-primitives/decorator/Decorator';
4
+ import { Center } from '../../../layout-primitives/center/Center';
5
+ import { Container } from '../../../layout-primitives/container/Container';
6
+ import { Cover, CoverContent } from '../../../layout-primitives/cover/Cover';
7
+ import { Layers } from '../../../layout-primitives/layers/Layers';
8
+ import { Stack } from '../../../layout-primitives/stack/Stack';
9
+ import { Text } from '../../../layout-primitives/text/Text';
10
+
11
+ export const Header6 = (props) => (
12
+ <Decorator backgroundColor={props.backgroundColor} color={props.color}>
13
+ <Layers cover>
14
+ <Decorator padding={props.padding}>
15
+ <Decorator backgroundColor="transparent" borderColor={props.borderColor} borderWidth="1px">
16
+ <Cover minHeight={`calc(100vh - var(--unitone--s${props.padding}) * 2`}>
17
+ <CoverContent>
18
+ <Container gutters={0} maxWidth="var(--unitone--measure)">
19
+ <Stack gap={2}>
20
+ {!!props.title && (
21
+ <Center>
22
+ <h2 style={{ '--unitone--font-size': 5 }}>{props.title}</h2>
23
+ </Center>
24
+ )}
25
+ {!!props.children && <Text center>{props.children}</Text>}
26
+ </Stack>
27
+ </Container>
28
+ </CoverContent>
29
+ </Cover>
30
+ </Decorator>
31
+ </Decorator>
32
+ </Layers>
33
+ </Decorator>
34
+ );
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+
3
+ import { Header6 } from '../Header6';
4
+
5
+ export default {
6
+ title: 'Patterns/Header/Header-6',
7
+ component: Header6,
8
+ argTypes: {
9
+ backgroundColor: {
10
+ control: { type: 'color' },
11
+ table: { defaultValue: { summary: '#000' } },
12
+ type: { name: 'string', required: false },
13
+ },
14
+ borderColor: {
15
+ control: { type: 'color' },
16
+ table: { defaultValue: { summary: '#fff' } },
17
+ type: { name: 'string', required: false },
18
+ },
19
+ color: {
20
+ control: { type: 'color' },
21
+ table: { defaultValue: { summary: '#fff' } },
22
+ type: { name: 'string', required: false },
23
+ },
24
+ padding: {
25
+ control: { type: 'inline-radio' },
26
+ options: [-2, -1, 1, 2, 3],
27
+ table: { defaultValue: { summary: 'var(--unitone--s1)' } },
28
+ type: { name: 'number', required: false },
29
+ },
30
+ },
31
+ args: {
32
+ backgroundColor: '#000',
33
+ borderColor: '#fff',
34
+ color: '#fff',
35
+ padding: 1,
36
+ },
37
+ parameters: {
38
+ layout: 'fullscreen',
39
+ },
40
+ };
41
+
42
+ export const Default = (props) => (
43
+ <Header6
44
+ src="https://placehold.jp/1280x1024.jpg"
45
+ title="Lorem ipsum dolor"
46
+ backgroundColor={props.backgroundColor}
47
+ borderColor={props.borderColor}
48
+ color={props.color}
49
+ padding={props.padding}
50
+ >
51
+ <p>
52
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit Lorem ipsum dolor sit amet,
53
+ consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
54
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
55
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill
56
+ </p>
57
+ </Header6>
58
+ );
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+
3
+ import { Decorator } from '../../../layout-primitives/decorator/Decorator';
4
+ import { Container } from '../../../layout-primitives/container/Container';
5
+ import { Cover, CoverContent } from '../../../layout-primitives/cover/Cover';
6
+ import { Stack } from '../../../layout-primitives/stack/Stack';
7
+ import { Text } from '../../../layout-primitives/text/Text';
8
+ import { WithSidebar } from '../../../layout-primitives/with-sidebar/WithSidebar';
9
+
10
+ export const MediaText1 = (props) => (
11
+ <Decorator color={props.color}>
12
+ <WithSidebar
13
+ gap={2}
14
+ contentMinWidth="min(100%, var(--unitone--measure) / 2)"
15
+ sidebar="left"
16
+ sidebarWidth="50%"
17
+ alignItems="center"
18
+ revert
19
+ >
20
+ <Cover noPadding minHeight="0">
21
+ <CoverContent>
22
+ <Container gutters={0} maxWidth="var(--unitone--measure)">
23
+ <Stack gap={2}>
24
+ {!!props.title && (
25
+ <Stack style={{ '--unitone--font-size': 4 }}>
26
+ <h2>{props.title}</h2>
27
+ </Stack>
28
+ )}
29
+ <Text center>{props.children}</Text>
30
+ </Stack>
31
+ </Container>
32
+ </CoverContent>
33
+ </Cover>
34
+ {!!props.src && (
35
+ <div>
36
+ <img src={props.src} alt="" />
37
+ </div>
38
+ )}
39
+ </WithSidebar>
40
+ </Decorator>
41
+ );
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ import { MediaText1 } from '../MediaText1';
4
+
5
+ export default {
6
+ title: 'Patterns/MediaText/MediaText-1',
7
+ component: MediaText1,
8
+ argTypes: {
9
+ color: {
10
+ control: { type: 'color' },
11
+ table: { defaultValue: { summary: 'initial' } },
12
+ type: { name: 'string', required: false },
13
+ },
14
+ },
15
+ args: {
16
+ color: 'initial',
17
+ },
18
+ };
19
+
20
+ export const Default = (props) => (
21
+ <MediaText1
22
+ src="https://placehold.jp/1024x1280.jpg"
23
+ title="Lorem ipsum dolor sit amet, consectetur adipisicing elit"
24
+ backgroundColor={props.backgroundColor}
25
+ color={props.color}
26
+ >
27
+ <p>
28
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
29
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
30
+ laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
31
+ voluptate velit esse cill
32
+ </p>
33
+ </MediaText1>
34
+ );
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+
3
+ import { Decorator } from '../../../layout-primitives/decorator/Decorator';
4
+ import { Container } from '../../../layout-primitives/container/Container';
5
+ import { Cover, CoverContent } from '../../../layout-primitives/cover/Cover';
6
+ import { Stack } from '../../../layout-primitives/stack/Stack';
7
+ import { WithSidebar } from '../../../layout-primitives/with-sidebar/WithSidebar';
8
+
9
+ export const MediaText2 = (props) => (
10
+ <Decorator color={props.color}>
11
+ <WithSidebar
12
+ gap={2}
13
+ contentMinWidth="min(100%, var(--unitone--measure) / 2)"
14
+ sidebar="right"
15
+ sidebarWidth="50%"
16
+ alignItems="center"
17
+ >
18
+ <Cover noPadding minHeight="0">
19
+ <CoverContent>
20
+ <Container gutters={0} maxWidth="var(--unitone--measure)">
21
+ <Stack gap={2}>
22
+ {!!props.title && (
23
+ <Stack style={{ '--unitone--font-size': 4 }}>
24
+ <h2>{props.title}</h2>
25
+ </Stack>
26
+ )}
27
+ <Stack>{props.children}</Stack>
28
+ </Stack>
29
+ </Container>
30
+ </CoverContent>
31
+ </Cover>
32
+ {!!props.src && (
33
+ <div>
34
+ <img src={props.src} alt="" />
35
+ </div>
36
+ )}
37
+ </WithSidebar>
38
+ </Decorator>
39
+ );
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ import { MediaText2 } from '../MediaText2';
4
+
5
+ export default {
6
+ title: 'Patterns/MediaText/MediaText-2',
7
+ component: MediaText2,
8
+ argTypes: {
9
+ color: {
10
+ control: { type: 'color' },
11
+ table: { defaultValue: { summary: 'initial' } },
12
+ type: { name: 'string', required: false },
13
+ },
14
+ },
15
+ args: {
16
+ color: 'initial',
17
+ },
18
+ };
19
+
20
+ export const Default = (props) => (
21
+ <MediaText2
22
+ src="https://placehold.jp/1024x1280.jpg"
23
+ title="Lorem ipsum dolor sit amet, consectetur adipisicing elit"
24
+ backgroundColor={props.backgroundColor}
25
+ color={props.color}
26
+ >
27
+ <p>
28
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
29
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
30
+ laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
31
+ voluptate velit esse cill
32
+ </p>
33
+ </MediaText2>
34
+ );
@@ -0,0 +1,8 @@
1
+ body {
2
+ background-color: var(--unitone--color-white);
3
+ color: var(--unitone--color-text);
4
+ font-family: var(--unitone--font-family);
5
+ -webkit-font-smoothing: antialiased;
6
+ // -moz-osx-font-smooting: grayscale; // White out elements will activate this.
7
+ overflow-wrap: break-word;
8
+ }
@@ -0,0 +1,3 @@
1
+ html {
2
+ font-size: calc(var(--unitone--base-font-size) * 1px);
3
+ }
@@ -0,0 +1,152 @@
1
+ @use 'sass:list';
2
+ @use 'sass:math';
3
+ @use '../variables/variables' as variables;
4
+
5
+ :root {
6
+ /**
7
+ * Column width in typography.
8
+ */
9
+ --unitone--measure: 38rem;
10
+
11
+ /**
12
+ * Collors.
13
+ */
14
+ --unitone--color-white: #fff;
15
+ --unitone--color-black: #000;
16
+ --unitone--color-text: #222;
17
+
18
+ /**
19
+ * Font size level.
20
+ * It is not recommended to override this value with :root in order to have the size determined based on 0.
21
+ */
22
+ --unitone--font-size: 0;
23
+
24
+ /**
25
+ * The 1rem px font size (no units).
26
+ */
27
+ --unitone--base-font-size: 16;
28
+
29
+ --unitone--harmonic-sequence-base: 8;
30
+ --unitone--min-harmonic-sequence-base: 9;
31
+ --unitone--max-harmonic-sequence-base: var(--unitone--harmonic-sequence-base);
32
+
33
+ /**
34
+ * Gutter provided above and below the text in a line.
35
+ */
36
+ --unitone--half-leading: .3;
37
+
38
+ /**
39
+ * The line-height slope. If smaller, the line-height is adjusted to a smaller value as the font size increases.
40
+ *
41
+ * A =(1, 1.6) // 1rem / 1.6
42
+ * B =(4, 1.1) // 4rem / 1.1
43
+ * y = -0.1666666666667x + 1.7666666666667 // y = line-height, x = Font size ratio
44
+ *
45
+ * @see https://www.geogebra.org/graphing?lang=ja
46
+ */
47
+ --unitone--line-height-slope: -0.16666;
48
+
49
+ /**
50
+ * Font family
51
+ */
52
+ --unitone--font-family: sans-serif;
53
+
54
+ /**
55
+ * Reference value of the modular scale for space.
56
+ */
57
+ --unitone--_space-reference-value: #{ variables.$line-height } / 3;
58
+
59
+ /**
60
+ * Modular scales for spaces.
61
+ */
62
+ --unitone--ms-2: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 1) });
63
+ --unitone--ms-1: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 2) });
64
+ --unitone--ms0: 0;
65
+ --unitone--ms1: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 3) });
66
+ --unitone--ms2: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 4) });
67
+ --unitone--ms3: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 5) });
68
+ --unitone--ms4: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 6) });
69
+ --unitone--ms5: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 7) });
70
+ --unitone--ms6: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 8) });
71
+ --unitone--ms7: calc(var(--unitone--_space-reference-value) * #{ list.nth(variables.$fibonacci-sequence, 9) });
72
+
73
+ /**
74
+ * Modular scales for spaces (em based).
75
+ */
76
+ --unitone--em-2: calc(1em * var(--unitone--ms-2));
77
+ --unitone--em-1: calc(1em * var(--unitone--ms-1));
78
+ --unitone--em0: 0em;
79
+ --unitone--em1: calc(1em * var(--unitone--ms1));
80
+ --unitone--em2: calc(1em * var(--unitone--ms2));
81
+ --unitone--em3: calc(1em * var(--unitone--ms3));
82
+ --unitone--em4: calc(1em * var(--unitone--ms4));
83
+ --unitone--em5: calc(1em * var(--unitone--ms5));
84
+ --unitone--em6: calc(1em * var(--unitone--ms6));
85
+ --unitone--em7: calc(1em * var(--unitone--ms7));
86
+
87
+ /**
88
+ * Modular scales for spaces (rem based).
89
+ */
90
+ --unitone--rem-2: calc(1rem * var(--unitone--ms-2));
91
+ --unitone--rem-1: calc(1rem * var(--unitone--ms-1));
92
+ --unitone--rem0: 0rem;
93
+ --unitone--rem1: calc(1rem * var(--unitone--ms1));
94
+ --unitone--rem2: calc(1rem * var(--unitone--ms2));
95
+ --unitone--rem3: calc(1rem * var(--unitone--ms3));
96
+ --unitone--rem4: calc(1rem * var(--unitone--ms4));
97
+ --unitone--rem5: calc(1rem * var(--unitone--ms5));
98
+ --unitone--rem6: calc(1rem * var(--unitone--ms6));
99
+ --unitone--rem7: calc(1rem * var(--unitone--ms7));
100
+
101
+ /**
102
+ * Modular scales for spaces.
103
+ */
104
+ @function _generate-fluid-spacing($min, $max) {
105
+ $slope: calc((#{ $max } - #{ $min }) / (#{ variables.$max-breakpoint - variables.$min-breakpoint }));
106
+ $yAxis: calc(#{ -1 * variables.$min-breakpoint } * #{ $slope } + #{ $min });
107
+ $preferredValue: calc(#{ $yAxis } * 1em + #{ $slope } * 100vw);
108
+ @return clamp(#{ $min } * 1em, #{ $preferredValue }, #{ $max } * 1em);
109
+ }
110
+ $_quotient: math.div(variables.$min-breakpoint, variables.$max-breakpoint);
111
+ --unitone--s-2: var(--unitone--em-2);
112
+ --unitone--s-1: var(--unitone--em-1);
113
+ --unitone--s0: var(--unitone--em0);
114
+ --unitone--s1: var(--unitone--em1);
115
+ --unitone--s2: #{ _generate-fluid-spacing(calc(var(--unitone--ms1) + var(--unitone--ms2) * #{ $_quotient }), var(--unitone--ms2)) };
116
+ --unitone--s3: #{ _generate-fluid-spacing(calc(var(--unitone--ms1) + var(--unitone--ms3) * #{ $_quotient }), var(--unitone--ms3)) };
117
+ --unitone--s4: #{ _generate-fluid-spacing(calc(var(--unitone--ms1) + var(--unitone--ms4) * #{ $_quotient }), var(--unitone--ms4)) };
118
+ --unitone--s5: #{ _generate-fluid-spacing(calc(var(--unitone--ms1) + var(--unitone--ms5) * #{ $_quotient }), var(--unitone--ms5)) };
119
+ --unitone--s6: #{ _generate-fluid-spacing(calc(var(--unitone--ms1) + var(--unitone--ms6) * #{ $_quotient }), var(--unitone--ms6)) };
120
+ --unitone--s7: #{ _generate-fluid-spacing(calc(var(--unitone--ms1) + var(--unitone--ms7) * #{ $_quotient }), var(--unitone--ms7)) };
121
+
122
+ /**
123
+ * Max width of the container.
124
+ */
125
+ --unitone--container-max-width: #{ variables.$container-max-width };
126
+
127
+ $_grid-columns: 12;
128
+ --unitone--_grid-gutters: calc(#{ $_grid-columns - 1 } * var(--unitone--s1));
129
+
130
+ /**
131
+ * Grid sizes (% based).
132
+ */
133
+ $_percentage-grid-width: calc((100% - var(--unitone--_grid-gutters)) / #{ $_grid-columns });
134
+ --unitone--pg0: 0%;
135
+ @for $i from 1 through $_grid-columns {
136
+ --unitone--pg#{ $i }: calc(#{ $_percentage-grid-width } * #{ $i } + var(--unitone--s1) * #{ $i - 1 });
137
+ }
138
+
139
+ /**
140
+ * Grid sizes (container based).
141
+ */
142
+ $_container-grid-width: calc((var(--unitone--container-max-width) - var(--unitone--_grid-gutters)) / #{ $_grid-columns });
143
+ --unitone--cg0: 0%;
144
+ @for $i from 1 through $_grid-columns {
145
+ --unitone--cg#{ $i }: calc(#{ $_container-grid-width } * #{ $i } + var(--unitone--s1) * #{ $i - 1 });
146
+ }
147
+
148
+ /**
149
+ * Box shadow
150
+ */
151
+ --unitone--shadow: 0 5px 20px -5px rgb(0 0 0 / 20%);
152
+ }
@@ -0,0 +1,3 @@
1
+ @use 'root';
2
+ @use 'html';
3
+ @use 'body';
@@ -0,0 +1,27 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="1: Introduction" />
4
+
5
+ # Introduction
6
+
7
+ unitone CSS is a CSS framework. This framework was inspired by [EVERY LAYOUT](https://every-layout.dev/).
8
+
9
+ ## GitHub
10
+
11
+ https://github.com/inc2734/unitone-css
12
+
13
+ ## NPM
14
+
15
+ https://www.npmjs.com/package/@inc2734/unitone-css
16
+
17
+ ## Storybook
18
+
19
+ https://inc2734.github.io/unitone-css
20
+
21
+ ## Browser support
22
+
23
+ Modern browser only.
24
+
25
+ ## License
26
+
27
+ MIT
@@ -0,0 +1,23 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="2: Get started" />
4
+
5
+ # Get started
6
+
7
+ ## Install
8
+
9
+ ```shell
10
+ $ npm install --save-dev @inc2734/unitone-css
11
+ ```
12
+
13
+ ### Using Sass
14
+
15
+ ```scss
16
+ @use 'PATH/TO/node_modules/@inc2734/unitone-css/src/app';
17
+ ```
18
+
19
+ ### Using CSS
20
+
21
+ ```html
22
+ <link rel="stylesheet" href="/node_modules/@inc2734/unitone-css/dist/app.css" />
23
+ ```
@@ -0,0 +1,57 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="3: Global API" />
4
+
5
+ # Global API
6
+
7
+ ## Font size
8
+
9
+ You can scale the font size with the CSS custom property `--unitone--font-size`. The minimum value is `1` and the maximum value is `7`. If you scale the font size with this CSS custom property, the `line-height` will be automatically set to an appropriate value.
10
+
11
+ ```html
12
+ <p style="--unitone--font-size: 2">
13
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
14
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
15
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
16
+ esse cill
17
+ </p>
18
+ ```
19
+
20
+ ## Line height
21
+
22
+ The half leading can be set. The default value is `0.3`.
23
+
24
+ ```html
25
+ <p style="--unitone--half-leading: .4">
26
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
27
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
28
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
29
+ esse cill
30
+ </p>
31
+ ```
32
+
33
+ ## Fluid typography
34
+
35
+ You can using fluid typography. The font-size and the line-height change fluidly according to screen size.
36
+
37
+ ```html
38
+ <p style="--unitone--font-size: 7" data-unitone-layout="-fluid-typography">
39
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
40
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
41
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
42
+ esse cill
43
+ </p>
44
+ ```
45
+
46
+ ## Margin / Padding
47
+
48
+ You can set the properly scaled margin and padding by using CSS custom properties. The minimum value is `--unitone--s-2` and the maximum value is `--unitone--s4`. `--unitone--s1` is the base value (`1rem`) and `--unitone--s0` is `0`.
49
+
50
+ ```html
51
+ <div style="margin: var(--unitone--s2); padding: var(--unitone--s1)">
52
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
53
+ labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
54
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
55
+ esse cill
56
+ </div>
57
+ ```
@@ -0,0 +1,11 @@
1
+ @use 'settings/settings';
2
+ @use 'foundation/foundation';
3
+ @use 'layout-primitives/layout-primitives';
4
+ @use 'helper/helper';
5
+
6
+ #root,
7
+ .docs-story {
8
+ @include foundation.foundation();
9
+ @include layout-primitives.layout-primitives();
10
+ @include helper.helper();
11
+ }
@@ -0,0 +1,22 @@
1
+ $fibonacci-sequence: 1, 2, 3, 5, 8, 13, 21, 34, 55;
2
+
3
+ $min-breakpoint: 22.5; // = 360px
4
+ $max-breakpoint: 80; // = 1280px
5
+
6
+ $_font-size-scale: calc(var(--unitone--harmonic-sequence-base) / (var(--unitone--harmonic-sequence-base) - var(--unitone--font-size)));
7
+ $font-size: calc($_font-size-scale * 1rem);
8
+
9
+ $_max-font-size: calc(var(--unitone--max-harmonic-sequence-base) / (var(--unitone--max-harmonic-sequence-base) - var(--unitone--font-size)));
10
+ $_min-font-size: calc(var(--unitone--min-harmonic-sequence-base) / (var(--unitone--min-harmonic-sequence-base) - var(--unitone--font-size)));
11
+ $_slope: calc((#{ $_max-font-size } - #{ $_min-font-size }) / (#{ $max-breakpoint - $min-breakpoint }));
12
+ $_yAxis: calc(#{-1 * $min-breakpoint } * #{ $_slope } + #{ $_min-font-size });
13
+ $_preferred-font-size: calc((#{ $_yAxis } * 1rem) + (#{ $_slope } * 100vw));
14
+ $fluid-font-size: clamp(1rem * #{ $_min-font-size }, #{ $_preferred-font-size }, 1rem * #{ $_max-font-size });
15
+
16
+ $line-height: clamp(
17
+ 1,
18
+ var(--unitone--line-height-slope) * var(--unitone--fluid-font-size-magnification, #{ $_font-size-scale }) + 1 + 2 * var(--unitone--half-leading) + -1 * var(--unitone--line-height-slope),
19
+ 2 * var(--unitone--half-leading) + 1
20
+ );
21
+
22
+ $container-max-width: $max-breakpoint * 16px; // = 1280px