css-zero 0.0.2 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06fbbf313570aa8314a8d4a3fe447220f2642a468c44a0910c82e2e1da7fcfd4
4
- data.tar.gz: 96f848c73205fd3a031094148d0595e944c2390d50cdbb5c7c39c234e1661423
3
+ metadata.gz: 2149b217f9d225d451b4dab77a7a8d1bd6688f4f2803c4c2cfc2a9db4a4cfc17
4
+ data.tar.gz: e42caf8bba711980b893660635b006e3f638dca1fbb8c020f7b528a17a4a8fd4
5
5
  SHA512:
6
- metadata.gz: 241c0d3d460b9cb9b35a7f3f58efab830ae390bab038823ad52388e29c414fe4a27fa3670148ce37c05dbddd2efc1123aae9a4e76eecb25801e5e12f4085327c
7
- data.tar.gz: fd56376c326bd18dc4ec2bee6d45e4c89e5919b3b1869ce70d4fb38af150c04cf1b95203f28300e6ef26b4c628cb890d73b79ffb925322438222c3a137018e93
6
+ metadata.gz: 6f61ab537f4ca362c2025e6931de17633f929e1fd7b46391648c325c7a70e3db2f1ad1c57867e1675ae294385fd3533f6e7cf419a39b09f775bff71b4e1e6084
7
+ data.tar.gz: f7fae72b818048b241a62e5262ba76ca1ad88bbf41bcfdbcbbdda227a760c397791b5aadd973757784adbb90a77146ebea322910a8c70019cc360139485bcbbe
data/README.md CHANGED
@@ -12,25 +12,25 @@ This gem requires [propshaft](https://github.com/rails/propshaft) as the asset p
12
12
 
13
13
  ## Usage
14
14
 
15
+ ```html
16
+ <h1 class="text-xl font-bold mb-md">
17
+ Write most page content using utility classes. Use what is available or add more when needed.
18
+ </h1>
19
+
20
+ <div class="component">
21
+ Write custom CSS using predefined variables for more complex stuff.
22
+ </div>
23
+ ```
24
+
15
25
  ```css
16
26
  .component {
17
- background-color: var(--red-500);
27
+ background-color: var(--red-500);
18
28
  border-radius: var(--rounded);
19
29
  height: var(--size-4);
20
-
21
- @media (min-width: 48rem) {
22
- display: none;
23
- }
24
30
  }
25
31
  ```
26
32
 
27
- ```html
28
- <div class="component mbe-md">
29
- <p>content here...</p>
30
- </div>
31
- ```
32
-
33
- ## Files
33
+ ## Reference
34
34
 
35
35
  - [Sizes](app/assets/stylesheets/sizes.css)
36
36
  - [Colors](app/assets/stylesheets/colors.css)
@@ -44,6 +44,27 @@ This gem requires [propshaft](https://github.com/rails/propshaft) as the asset p
44
44
  - [Animations](app/assets/stylesheets/animations.css)
45
45
  - [Utilities](app/assets/stylesheets/zutilities.css)
46
46
 
47
+ ## Customization
48
+
49
+ ```css
50
+ :root {
51
+ --color-negative: var(--pink-700);
52
+ --color-postive: var(--lime-700);
53
+ --color-bg: white;
54
+ --color-bg-surface: var(--zinc-100);
55
+ --color-text: var(--zinc-950);
56
+ --color-text-reversed: white;
57
+ --color-text-subtle: var(--zinc-500);
58
+ --color-border: var(--zinc-200);
59
+ }
60
+ ```
61
+
62
+ ```html
63
+ <div class="flex flex-column w-full gap" style="--row-gap: 0.5rem">
64
+ More HTML tags here...
65
+ </div>
66
+ ```
67
+
47
68
  ## Development
48
69
 
49
70
  To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
@@ -1,4 +1,5 @@
1
1
  :root {
2
+ /* Named color values */
2
3
  --slate-50: #f8fafc;
3
4
  --slate-100: #f1f5f9;
4
5
  --slate-200: #e2e8f0;
@@ -262,4 +263,26 @@
262
263
  --rose-800: #9f1239;
263
264
  --rose-900: #881337;
264
265
  --rose-950: #4c0519;
266
+
267
+ /* Abstractions */
268
+ --color-negative: var(--pink-700);
269
+ --color-postive: var(--lime-700);
270
+ --color-bg: white;
271
+ --color-bg-surface: var(--zinc-100);
272
+ --color-text: var(--zinc-950);
273
+ --color-text-reversed: white;
274
+ --color-text-subtle: var(--zinc-500);
275
+ --color-border: var(--zinc-200);
276
+
277
+ /* Redefine named color values for dark mode */
278
+ @media (prefers-color-scheme: dark) {
279
+ --color-negative: var(--pink-400);
280
+ --color-postive: var(--lime-300);
281
+ --color-bg: var(--zinc-900);
282
+ --color-bg-surface: var(--zinc-950);
283
+ --color-text: white;
284
+ --color-text-reversed: var(--zinc-950);
285
+ --color-text-subtle: var(--zinc-400);
286
+ --color-border: rgba(255, 255, 255, 0.1);
287
+ }
265
288
  }
@@ -70,19 +70,20 @@
70
70
  /****************************************************************
71
71
  * Widths
72
72
  *****************************************************************/
73
- --width-3xs: 16rem; /* 256px */
74
- --width-2xs: 18rem; /* 288px */
75
- --width-xs: 20rem; /* 320px */
76
- --width-sm: 24rem; /* 384px */
77
- --width-md: 28rem; /* 448px */
78
- --width-lg: 32rem; /* 512px */
79
- --width-xl: 36rem; /* 576px */
80
- --width-2xl: 42rem; /* 672px */
81
- --width-3xl: 48rem; /* 768px */
82
- --width-4xl: 56rem; /* 896px */
83
- --width-5xl: 64rem; /* 1024px */
84
- --width-6xl: 72rem; /* 1152px */
85
- --width-7xl: 80rem; /* 1280px */
73
+ --width-3xs: 16rem; /* 256px */
74
+ --width-2xs: 18rem; /* 288px */
75
+ --width-xs: 20rem; /* 320px */
76
+ --width-sm: 24rem; /* 384px */
77
+ --width-md: 28rem; /* 448px */
78
+ --width-lg: 32rem; /* 512px */
79
+ --width-xl: 36rem; /* 576px */
80
+ --width-2xl: 42rem; /* 672px */
81
+ --width-3xl: 48rem; /* 768px */
82
+ --width-4xl: 56rem; /* 896px */
83
+ --width-5xl: 64rem; /* 1024px */
84
+ --width-6xl: 72rem; /* 1152px */
85
+ --width-7xl: 80rem; /* 1280px */
86
+ --width-prose: 65ch;
86
87
 
87
88
  /****************************************************************
88
89
  * Breakpoints
@@ -47,7 +47,7 @@
47
47
  /****************************************************************
48
48
  * Text
49
49
  *****************************************************************/
50
- .font-normal { font-weight: var(--font-normal); }
50
+ .font-normal { font-weight: var(--font-normal); font-style: normal; }
51
51
  .font-medium { font-weight: var(--font-medium); }
52
52
  .font-bold { font-weight: var(--font-bold); }
53
53
 
@@ -71,7 +71,11 @@
71
71
  .leading-tight { line-height: var(--leading-tight); }
72
72
  .leading-normal { line-height: var(--leading-normal); }
73
73
 
74
- .text-inherit { color: inherit; }
74
+ .text-primary { color: var(--color-text); }
75
+ .text-reversed { color: var(--color-text-reversed); }
76
+ .text-subtle { color: var(--color-text-subtle); }
77
+ .text-negative { color: var(--color-negative); }
78
+ .text-positive { color: var(--color-positive); }
75
79
 
76
80
  .text-xs { font-size: var(--text-xs); }
77
81
  .text-sm { font-size: var(--text-sm); }
@@ -83,16 +87,36 @@
83
87
  .text-4xl { font-size: var(--text-4xl); }
84
88
  .text-5xl { font-size: var(--text-5xl); }
85
89
 
90
+ /****************************************************************
91
+ * Background
92
+ *****************************************************************/
93
+ .bg-main { background-color: var(--color-bg); }
94
+ .bg-white { background-color: var(--color-text-reversed); }
95
+ .bg-surface { background-color: var(--color-bg-surface); }
96
+ .bg-transparent { background-color: transparent; }
97
+
86
98
  /****************************************************************
87
99
  * Border
88
100
  *****************************************************************/
89
- .border-0 { border-width: 0px; }
90
- .border-t { border-top-width: 1px; }
91
- .border-b { border-bottom-width: 1px; }
92
- .border-l { border-left-width: 1px; }
93
- .border-r { border-right-width: 1px; }
94
- .border { border-width: 1px; }
95
- .rounded-full { border-radius: 9999px; }
101
+ .border { border: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
102
+ .border-t { border-top: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
103
+ .border-b { border-bottom: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
104
+ .border-l { border-left: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
105
+ .border-r { border-right: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
106
+ .border-0 { border: 0; }
107
+
108
+ .rounded-sm { border-radius: var(--rounded-sm); }
109
+ .rounded { border-radius: var(--rounded); }
110
+ .rounded-lg { border-radius: var(--rounded-lg); }
111
+ .rounded-full { border-radius: var(--rounded-full); }
112
+
113
+ /****************************************************************
114
+ * Shadow
115
+ *****************************************************************/
116
+ .shadow { box-shadow: var(--shadow); }
117
+ .shadow-md { box-shadow: var(--shadow-md); }
118
+ .shadow-lg { box-shadow: var(--shadow-lg); }
119
+ .shadow-xl { box-shadow: var(--shadow-xl); }
96
120
 
97
121
  /****************************************************************
98
122
  * Layout
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CssZero
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-08 00:00:00.000000000 Z
11
+ date: 2024-06-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com