ssstyles 0.0.1-test

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Daniel Schulz (iamschulz.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Ssstyles
2
+
3
+ Ssstyles is a very simple CSS style system. It consists of a classless stylesheet as a base layer and some small, optional components on top.
4
+
5
+ It's supposed to be:
6
+
7
+ - Lightweight
8
+ - Configurable
9
+ - Hackable
10
+ - Accessible
11
+
12
+ You can use this as a quick start for simple websites and build your own stuff on top.
13
+
14
+ ## Usage
15
+
16
+ You have multiple options to install Ssstyles. I provide two packages:
17
+
18
+ - The base styles, which include a classless stylesheet for simple HTML sites
19
+ - The complete base+components package, which you can use to build more advanced sites
20
+
21
+ ### CDN
22
+
23
+ Use this snippet to insert the **base styles**:
24
+
25
+ ```html
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/package@version/file" />
27
+ ```
28
+
29
+ Use this snippet to insert the base styles **and all components**:
30
+
31
+ ```html
32
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/package@version/file" />
33
+ ```
34
+
35
+ ### npm
36
+
37
+ ```bash
38
+ npm install ssstyles
39
+ ```
40
+
41
+ ```css
42
+ @layer base, layout, components;
43
+ @import "ssstyles" layer(base);
44
+ @import "ssstyles/css/transition.css" layer(base);
45
+ @import "ssstyles/css/basegrid.css" layer(layout);
46
+ @import "ssstyles/css/headline.css" layer(components);
47
+ /* Whatever components you need */
48
+
49
+ /* Or the complete package: */
50
+ @import "ssstyles/css/all.css" layer(base);
51
+ ```
52
+
53
+ ### Manual installation
54
+
55
+ You can also simply download the CSS file and include it however you wish.
56
+
57
+ ## More info
58
+
59
+ Fore more information pleaee visit the [project site](https://iamschulz.github.io/ssstyles).
@@ -0,0 +1,22 @@
1
+ [data-actionlink] {
2
+ --actionlink-size: 3rem;
3
+ --col-button: var(--col-accent);
4
+ position: fixed;
5
+ bottom: 2rem;
6
+ right: 2rem;
7
+ min-height: var(--actionlink-size);
8
+ min-width: var(--actionlink-size);
9
+ border-radius: var(--actionlink-size);
10
+ background-color: var(--col-button);
11
+ color: var(--col-accent-contrast);
12
+ font-weight: 600;
13
+ display: grid;
14
+ place-items: center;
15
+ padding: 1ch;
16
+ text-decoration: none;
17
+ z-index: 1;
18
+
19
+ &:hover {
20
+ background-color: color-mix(in oklab, var(--col-button), white 10%);
21
+ }
22
+ }
@@ -0,0 +1,113 @@
1
+ @keyframes fade-in {
2
+ from {
3
+ opacity: 0;
4
+ translate: 0 1rem;
5
+ }
6
+ to {
7
+ opacity: 1;
8
+ translate: 0 0;
9
+ }
10
+ }
11
+
12
+ [data-fade-in] {
13
+ view-timeline-name: --fade-in;
14
+ view-timeline-axis: block;
15
+
16
+ @media (prefers-reduced-motion: no-preference) {
17
+ animation: ease-in-out fade-in both;
18
+ animation-timeline: --fade-in;
19
+ animation-range: entry -10% cover 20%;
20
+ }
21
+ }
22
+
23
+ @keyframes sparkle {
24
+ 0% {
25
+ opacity: 0;
26
+ translate: -0.7ch -10%;
27
+ }
28
+ 10% {
29
+ opacity: 1;
30
+ translate: -0.7ch -10%;
31
+ }
32
+ 20% {
33
+ opacity: 0;
34
+ translate: -0.7ch -10%;
35
+ }
36
+
37
+ 25% {
38
+ opacity: 0;
39
+ translate: 60% -30%;
40
+ }
41
+ 35% {
42
+ opacity: 1;
43
+ translate: 60% -30%;
44
+ }
45
+ 45% {
46
+ opacity: 0;
47
+ translate: 60% -30%;
48
+ }
49
+
50
+ 55% {
51
+ opacity: 0;
52
+ translate: 30% 0;
53
+ }
54
+ 65% {
55
+ opacity: 1;
56
+ translate: 30% 0;
57
+ }
58
+ 75% {
59
+ opacity: 0;
60
+ translate: 30% 0;
61
+ }
62
+
63
+ 80% {
64
+ opacity: 0;
65
+ translate: calc(100% - 1.3ch) -20%;
66
+ }
67
+ 90% {
68
+ opacity: 1;
69
+ translate: calc(100% - 1.3ch) -20%;
70
+ }
71
+ 100% {
72
+ opacity: 0;
73
+ translate: calc(100% - 1.3ch) -20%;
74
+ }
75
+ }
76
+
77
+ [data-sparkle] {
78
+ --sparkle-color: oklch(100% 0 259.28 / 100%);
79
+ position: relative;
80
+ text-shadow: 0 0 10px var(--sparkle-color);
81
+ letter-spacing: calc(var(--letter-spacing) + 0.03em);
82
+
83
+ &::before,
84
+ &::after {
85
+ content: "✨";
86
+ position: absolute;
87
+ inset: 0;
88
+ text-shadow: 0 0 10px var(--sparkle-color);
89
+ animation: sparkle 3s ease-in-out infinite;
90
+
91
+ @media (prefers-reduced-motion) {
92
+ animation: none;
93
+ }
94
+ }
95
+
96
+ &::after {
97
+ animation-delay: 1s;
98
+ }
99
+
100
+ @media (prefers-color-scheme: dark) {
101
+ --sparkle-color: oklch(100% 0 259.28 / 50%);
102
+ }
103
+
104
+ @media (prefers-reduced-motion) {
105
+ &::before,
106
+ &::after {
107
+ animation: none;
108
+ position: relative;
109
+ }
110
+ }
111
+ }
112
+
113
+ /* todo: view transitions */
@@ -0,0 +1,20 @@
1
+ [data-autogrid] {
2
+ --gap: 1rem;
3
+ display: grid;
4
+ grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
5
+ justify-items: stretch;
6
+ align-items: flex-start;
7
+ gap: var(--gap);
8
+ }
9
+
10
+ [data-autogrid="1/4"] {
11
+ --grid-item-width: max(calc(25% - var(--gap) * 3), 140px);
12
+ }
13
+
14
+ [data-autogrid="1/3"] {
15
+ --grid-item-width: max(calc(33% - var(--gap) * 2), 200px);
16
+ }
17
+
18
+ [data-autogrid="1/2"] {
19
+ --grid-item-width: max(calc(50% - var(--gap)), 240px);
20
+ }
@@ -0,0 +1,28 @@
1
+ blockquote {
2
+ margin: 1rem 0;
3
+ padding: 1rem 2ch;
4
+ border-radius: var(--br-tl, var(--border-radius)) var(--br-tr, var(--border-radius))
5
+ var(--br-br, var(--border-radius)) var(--br-bl, var(--border-radius));
6
+ background: var(--col-bg2);
7
+ font-size: 1.2rem;
8
+ font-style: italic;
9
+ border: 2px solid var(--col-bg3);
10
+
11
+ > footer {
12
+ font-size: 1rem;
13
+ margin: 1rem 0 0 2ch;
14
+ font-style: normal;
15
+
16
+ &::before {
17
+ content: "— ";
18
+ }
19
+
20
+ cite {
21
+ font-style: italic;
22
+ }
23
+ }
24
+ }
25
+
26
+ figure > blockquote {
27
+ margin: 0;
28
+ }
@@ -0,0 +1,34 @@
1
+ button,
2
+ [data-button],
3
+ input[type="submit"],
4
+ input[type="button"],
5
+ input[type="reset"] {
6
+ --col-button: var(--col-accent);
7
+ --col-button2: var(--col-button);
8
+ --pos-gradient: -0.25rem;
9
+ padding: 0.25rem 1ch;
10
+ border: none;
11
+ border-radius: var(--br-tl, var(--border-radius)) var(--br-tr, var(--border-radius))
12
+ var(--br-br, var(--border-radius)) var(--br-bl, var(--border-radius));
13
+ color: var(--col-accent-contrast);
14
+ font-weight: 500;
15
+ text-decoration: none;
16
+ cursor: pointer;
17
+ background: linear-gradient(
18
+ to bottom,
19
+ var(--col-button2) calc(100% + var(--pos-gradient)),
20
+ color-mix(in oklab, var(--col-button2), black 20%) calc(100% + var(--pos-gradient))
21
+ );
22
+
23
+ &:hover:not(:is([disabled], [aria-disabled])) {
24
+ --col-button2: color-mix(in oklab, var(--col-button), white 10%);
25
+ }
26
+
27
+ &:active:not(:is([disabled], [aria-disabled])) {
28
+ --pos-gradient: -0.35rem;
29
+ }
30
+
31
+ &[data-button="accent2"] {
32
+ --col-button: var(--col-accent2);
33
+ }
34
+ }
@@ -0,0 +1,41 @@
1
+ code,
2
+ kbd,
3
+ pre {
4
+ background: var(--col-bg2);
5
+ border: 0.125rem solid var(--col-bg3);
6
+ border-radius: var(--br-tl, var(--border-radius)) var(--br-tr, var(--border-radius))
7
+ var(--br-br, var(--border-radius)) var(--br-bl, var(--border-radius));
8
+ padding: 0.05rem 0.5ch;
9
+ font-size: 0.8rem;
10
+ font-family: var(--font-mono);
11
+ font-weight: 600;
12
+ color: var(--col-accent2);
13
+ max-width: 100%;
14
+ overflow: auto;
15
+ text-wrap: nowrap;
16
+ }
17
+
18
+ pre {
19
+ padding: 0.5rem;
20
+ margin: 1rem 0;
21
+ }
22
+
23
+ kbd {
24
+ border-bottom: 0.25rem solid var(--col-bg3);
25
+ border-radius: var(--border-radius) var(--border-radius) 5px 5px;
26
+ font-weight: 700;
27
+ }
28
+
29
+ pre code,
30
+ code pre {
31
+ background: inherit;
32
+ font-size: inherit;
33
+ color: inherit;
34
+ border: 0;
35
+ margin: 0;
36
+ padding: 0;
37
+ }
38
+
39
+ code pre {
40
+ display: inline;
41
+ }
@@ -0,0 +1,17 @@
1
+ :root {
2
+ color-scheme: light dark;
3
+ background-color: var(--col-bg);
4
+ color: var(--col-fg);
5
+ }
6
+
7
+ * {
8
+ accent-color: var(--col-accent);
9
+ }
10
+
11
+ a:not([data-button]) {
12
+ color: var(--col-accent);
13
+
14
+ &:hover {
15
+ color: var(--col-accent2);
16
+ }
17
+ }
@@ -0,0 +1,34 @@
1
+ :root {
2
+ --body-width: 45rem;
3
+
4
+ --col-bg: #eee;
5
+ --col-bg2: #e8e8e8;
6
+ --col-bg3: #dfdfdf;
7
+ --col-fg: #333;
8
+ --col-fg2: #7c8386;
9
+ --col-accent: #b2033a;
10
+ --col-accent2: #1c618f;
11
+ --col-accent-contrast: #eee;
12
+
13
+ --font: Inter, Roboto, "Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif;
14
+ --font-mono: Consolas, monaco, "Ubuntu Mono", "Liberation Mono", "Courier New", Courier, monospace;
15
+ --font-size-min: 1rem;
16
+ --font-size-max: 1.2rem;
17
+ --line-height: 1.6;
18
+ --letter-spacing: 0.01875em;
19
+
20
+ --border-radius: 10px;
21
+ }
22
+
23
+ @media (prefers-color-scheme: dark) {
24
+ :root {
25
+ --col-bg: #15181a;
26
+ --col-bg2: #161e21;
27
+ --col-bg3: #1a2225;
28
+ --col-fg: #eee;
29
+ --col-fg2: #7c8386;
30
+ --col-accent: #ff297a;
31
+ --col-accent2: #72c4ff;
32
+ --col-accent-contrast: #111;
33
+ }
34
+ }
@@ -0,0 +1,36 @@
1
+ @keyframes dialog-fade-in {
2
+ from {
3
+ opacity: 0;
4
+ translate: 0 1rem;
5
+ }
6
+ to {
7
+ opacity: 1;
8
+ translate: 0 0;
9
+ }
10
+ }
11
+
12
+ body:has(dialog[open]) {
13
+ overflow: hidden;
14
+ }
15
+
16
+ dialog {
17
+ padding: 1rem 2ch;
18
+ border: 0.125rem solid var(--col-bg3);
19
+ background: var(--col-bg);
20
+ @media (prefers-reduced-motion: no-preference) {
21
+ animation: dialog-fade-in 0.1s ease-out;
22
+ }
23
+
24
+ > header {
25
+ background: var(--col-bg3);
26
+ margin: -1rem -2ch 1rem;
27
+ padding: 1rem 2ch;
28
+ font-weight: 700;
29
+ }
30
+
31
+ &::backdrop {
32
+ background: rgba(0, 0, 0, 0.4);
33
+ backdrop-filter: blur(4px);
34
+ animation: fade-in 0.1s ease-out;
35
+ }
36
+ }
@@ -0,0 +1,36 @@
1
+ fieldset {
2
+ background-color: var(--col-bg2);
3
+ border-radius: var(--br-tl, var(--border-radius)) var(--br-tr, var(--border-radius))
4
+ var(--br-br, var(--border-radius)) var(--br-bl, var(--border-radius));
5
+ border-color: var(--col-bg3);
6
+ border-style: solid;
7
+
8
+ :is(input:not(:is([type="button"], [type="submit"], [type="reset"])), textarea, select) {
9
+ background-color: color-mix(in lch, var(--col-bg2) 95%, var(--col-fg));
10
+ border-color: var(--col-fg2);
11
+ }
12
+ }
13
+
14
+ input:not(:is([type="button"], [type="submit"], [type="reset"])),
15
+ textarea,
16
+ select {
17
+ padding: 0.1rem 1ch;
18
+ background-color: var(--col-bg2);
19
+ border: 0.125rem solid var(--col-fg2);
20
+ --br-tl: var(--border-radius);
21
+ --br-tr: var(--border-radius);
22
+ --br-bl: var(--border-radius);
23
+ --br-br: var(--border-radius);
24
+ border-radius: var(--br-tl) var(--br-tr) var(--br-br) var(--br-bl);
25
+ }
26
+
27
+ textarea {
28
+ max-width: 100%;
29
+ }
30
+
31
+ select {
32
+ -webkit-appearance: none;
33
+ background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20height%3D%2740%27%20width%3D%27100%27%20fill%3D%22%23888%22%3E%3Cpolygon%20points%3D%220%2C0%2050%2C40%20100%2C0%22%2F%3E%3C%2Fsvg%3E")
34
+ calc(100% - 0.8rem) 50%/0.8rem no-repeat;
35
+ padding-right: 2rem;
36
+ }
@@ -0,0 +1,25 @@
1
+ @media (prefers-contrast: more) {
2
+ :root {
3
+ --col-bg: #fff;
4
+ --col-bg2: #fff;
5
+ --col-bg3: #fff;
6
+ --col-fg: #000;
7
+ --col-fg2: #000;
8
+ --col-accent: #800;
9
+ --col-accent2: #00f;
10
+ --col-accent-contrast: #fff;
11
+ }
12
+ }
13
+
14
+ @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
15
+ :root {
16
+ --col-bg: #000;
17
+ --col-bg2: #000;
18
+ --col-bg3: #000;
19
+ --col-fg: #fff;
20
+ --col-fg2: #fff;
21
+ --col-accent: #ff0;
22
+ --col-accent2: #0ff;
23
+ --col-accent-contrast: #000;
24
+ }
25
+ }
@@ -0,0 +1,58 @@
1
+ :root {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ body {
6
+ max-width: var(--body-width);
7
+ margin: auto;
8
+ padding: 0 1rem;
9
+ word-wrap: break-word;
10
+
11
+ > :is(header, footer) {
12
+ position: relative;
13
+ margin: 0 calc((50vw - 50%) * -1 + 1rem);
14
+ padding: 2rem calc(50vw - 50% - 1rem);
15
+ background: var(--col-bg3);
16
+
17
+ &::before {
18
+ content: "";
19
+ position: absolute;
20
+ inset: 0;
21
+ box-shadow: -2rem 0 0 0 var(--col-bg3), 2rem 0 0 0 var(--col-bg3);
22
+ z-index: -1;
23
+ }
24
+ }
25
+
26
+ &:not(:has(header)) {
27
+ padding-top: 1rem;
28
+ }
29
+
30
+ &:not(:has(footer)) {
31
+ padding-bottom: 1rem;
32
+ }
33
+
34
+ > header {
35
+ margin-bottom: 1rem;
36
+ }
37
+
38
+ > footer {
39
+ margin-top: 5rem;
40
+ }
41
+ }
42
+
43
+ figure,
44
+ video,
45
+ canvas,
46
+ iframe {
47
+ display: block;
48
+ max-width: 100%;
49
+ margin-inline-start: 0;
50
+ margin-inline-end: 0;
51
+ }
52
+
53
+ img,
54
+ svg {
55
+ max-width: 100%;
56
+ height: auto;
57
+ vertical-align: text-bottom;
58
+ }
@@ -0,0 +1,20 @@
1
+ hr {
2
+ border: 0.125rem solid var(--col-bg3);
3
+ border-radius: var(--border-radius);
4
+ margin: 5rem 0;
5
+ }
6
+
7
+ [disabled],
8
+ [aria-disabled] {
9
+ cursor: not-allowed;
10
+ filter: saturate(0);
11
+ }
12
+
13
+ abbr {
14
+ cursor: help;
15
+ }
16
+
17
+ mark {
18
+ background-color: var(--col-accent2);
19
+ color: var(--col-accent-contrast);
20
+ }
@@ -0,0 +1,46 @@
1
+ details {
2
+ background-color: var(--col-bg2);
3
+ border-color: var(--col-bg3);
4
+ border-style: solid;
5
+ border-radius: var(--br-tl, var(--border-radius)) var(--br-tr, var(--border-radius))
6
+ var(--br-br, var(--border-radius)) var(--br-bl, var(--border-radius));
7
+ padding: 0.5rem 1ch;
8
+
9
+ > summary {
10
+ position: relative;
11
+ font-weight: 500;
12
+ cursor: pointer;
13
+ padding-left: 1rem;
14
+ list-style-type: none;
15
+
16
+ &::marker,
17
+ &::-webkit-details-marker {
18
+ display: none;
19
+ }
20
+
21
+ &::before {
22
+ content: "";
23
+ position: absolute;
24
+ left: -1ch;
25
+ width: 0;
26
+ height: 0;
27
+ border: 0.5rem solid transparent;
28
+ border-left: 0.5rem solid var(--col-accent);
29
+ transform: translate(0.625rem, 0.25lh) rotate(var(--dstr, 0deg));
30
+ transform-origin: 25% center;
31
+ transition: transform 0.1s ease-out;
32
+ }
33
+
34
+ &:hover::before {
35
+ border-left-color: var(--col-accent2);
36
+ }
37
+ }
38
+
39
+ &[open] > summary {
40
+ margin-bottom: 1rem;
41
+
42
+ &::before {
43
+ --dstr: 90deg;
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,50 @@
1
+ table {
2
+ border-collapse: collapse;
3
+ table-layout: fixed;
4
+ min-width: 100%;
5
+ }
6
+
7
+ figure:has(table) {
8
+ overflow-x: auto;
9
+ }
10
+
11
+ thead {
12
+ border-bottom: 0.125rem solid var(--col-bg3);
13
+ }
14
+
15
+ tbody tr:nth-child(even) {
16
+ background-color: var(--col-bg2);
17
+ }
18
+
19
+ td,
20
+ th {
21
+ padding: 0.5rem 1ch;
22
+ text-align: left;
23
+ vertical-align: top;
24
+ white-space: nowrap;
25
+ }
26
+
27
+ tfoot {
28
+ border-top: 0.125rem solid var(--col-bg3);
29
+ }
30
+
31
+ dl {
32
+ & dd {
33
+ margin-inline-start: 0.5ch;
34
+
35
+ &::before {
36
+ content: "├";
37
+ margin-inline-end: 0.5ch;
38
+ font-family: var(--font-mono);
39
+ font-size: 2em;
40
+ position: relative;
41
+ top: 0.4rem;
42
+ line-height: 0;
43
+ color: var(--col-fg2);
44
+ }
45
+ &:last-of-type::before,
46
+ &:has(+ dt)::before {
47
+ content: "└";
48
+ }
49
+ }
50
+ }