css-zero 0.0.9 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +306 -104
  3. data/app/assets/stylesheets/_reset.css +1 -1
  4. data/app/assets/stylesheets/colors.css +0 -25
  5. data/app/assets/stylesheets/transform.css +32 -40
  6. data/app/assets/stylesheets/transition.css +2 -7
  7. data/app/assets/stylesheets/zutilities.css +43 -10
  8. data/lib/css-zero.rb +3 -6
  9. data/lib/css_zero/engine.rb +4 -0
  10. data/lib/css_zero/version.rb +1 -3
  11. data/lib/generators/css_zero/add/USAGE +8 -0
  12. data/lib/generators/css_zero/add/add_generator.rb +28 -0
  13. data/lib/generators/css_zero/add/resources.yml +27 -0
  14. data/lib/generators/css_zero/add/templates/app/assets/images/chevron-down.svg +1 -0
  15. data/lib/generators/css_zero/add/templates/app/assets/images/loader-circle.svg +1 -0
  16. data/lib/generators/css_zero/add/templates/app/assets/images/select-arrow.svg +1 -0
  17. data/lib/generators/css_zero/add/templates/app/assets/images/x.svg +1 -0
  18. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css +44 -0
  19. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/alert.css +18 -0
  20. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/alert_dialog.css +59 -0
  21. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/badge.css +30 -0
  22. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css +77 -0
  23. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/card.css +6 -0
  24. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css +64 -0
  25. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css +51 -0
  26. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/progress.css +45 -0
  27. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css +41 -0
  28. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css +27 -0
  29. data/lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_control_controller.js +17 -0
  30. data/lib/generators/css_zero/install/USAGE +5 -0
  31. data/lib/generators/css_zero/install/install_generator.rb +9 -0
  32. data/lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css +46 -0
  33. metadata +25 -7
  34. data/app/assets/stylesheets/base.css +0 -4
  35. data/app/assets/stylesheets/buttons.css +0 -46
  36. data/app/assets/stylesheets/dialog.css +0 -34
  37. data/app/assets/stylesheets/inputs.css +0 -43
  38. data/app/assets/stylesheets/separators.css +0 -4
@@ -0,0 +1,17 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static values = { target: String }
5
+
6
+ close() {
7
+ document.getElementById(this.targetValue).close()
8
+ }
9
+
10
+ show() {
11
+ document.getElementById(this.targetValue).show()
12
+ }
13
+
14
+ showModal() {
15
+ document.getElementById(this.targetValue).showModal()
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ Description:
2
+ This will copy base.css into your application.
3
+
4
+ Example:
5
+ bin/rails generate css_zero:install
@@ -0,0 +1,9 @@
1
+ require "rails/generators/named_base"
2
+
3
+ class CssZero::InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("templates", __dir__)
5
+
6
+ def copy_base_css
7
+ copy_file "app/assets/stylesheets/base.css"
8
+ end
9
+ end
@@ -0,0 +1,46 @@
1
+ :root {
2
+ /* Color Scheme */
3
+ color-scheme: light dark;
4
+
5
+ /* Abstractions */
6
+ --color-bg: light-dark(white, var(--zinc-950));
7
+ --color-text: light-dark(black, white);
8
+ --color-text-reversed: light-dark(white, black);
9
+ --color-text-subtle: light-dark(var(--zinc-500), var(--zinc-400));
10
+ --color-border: light-dark(var(--zinc-200), var(--zinc-800));
11
+ --color-border-darker: light-dark(var(--zinc-400), var(--zinc-300));
12
+
13
+ /* Accent colors */
14
+ --color-primary: light-dark(var(--zinc-900), var(--zinc-50));
15
+ --color-secondary: light-dark(var(--zinc-100), var(--zinc-800));
16
+ --color-negative: light-dark(var(--red-600), var(--red-900));
17
+ --color-positive: light-dark(var(--green-600), var(--green-900));
18
+
19
+ /* SVG color values */
20
+ --color-filter-text: invert(0);
21
+ --color-filter-text-reversed: invert(100%);
22
+ --color-filter-negative: invert(31%) sepia(96%) saturate(4646%) hue-rotate(350deg) brightness(91%) contrast(89%);
23
+ --color-filter-positive: invert(48%) sepia(74%) saturate(520%) hue-rotate(90deg) brightness(89%) contrast(90%);
24
+
25
+ @media (prefers-color-scheme: dark) {
26
+ --color-filter-text: invert(100%);
27
+ --color-filter-text-reversed: invert(0);
28
+ --color-filter-negative: invert(15%) sepia(83%) saturate(2066%) hue-rotate(345deg) brightness(87%) contrast(88%);
29
+ --color-filter-positive: invert(23%) sepia(74%) saturate(495%) hue-rotate(91deg) brightness(88%) contrast(89%);
30
+ }
31
+ }
32
+
33
+ * {
34
+ border-color: var(--color-border);
35
+ }
36
+
37
+ html {
38
+ scroll-behavior: smooth;
39
+ }
40
+
41
+ body {
42
+ background-color: var(--color-bg);
43
+ color: var(--color-text);
44
+ font-synthesis-weight: none;
45
+ text-rendering: optimizeLegibility;
46
+ }
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.9
4
+ version: 0.0.11
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-18 00:00:00.000000000 Z
11
+ date: 2024-07-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com
@@ -20,23 +20,41 @@ files:
20
20
  - Rakefile
21
21
  - app/assets/stylesheets/_reset.css
22
22
  - app/assets/stylesheets/animations.css
23
- - app/assets/stylesheets/base.css
24
23
  - app/assets/stylesheets/borders.css
25
- - app/assets/stylesheets/buttons.css
26
24
  - app/assets/stylesheets/colors.css
27
- - app/assets/stylesheets/dialog.css
28
25
  - app/assets/stylesheets/effects.css
29
26
  - app/assets/stylesheets/filters.css
30
27
  - app/assets/stylesheets/grid.css
31
- - app/assets/stylesheets/inputs.css
32
- - app/assets/stylesheets/separators.css
33
28
  - app/assets/stylesheets/sizes.css
34
29
  - app/assets/stylesheets/transform.css
35
30
  - app/assets/stylesheets/transition.css
36
31
  - app/assets/stylesheets/typography.css
37
32
  - app/assets/stylesheets/zutilities.css
38
33
  - lib/css-zero.rb
34
+ - lib/css_zero/engine.rb
39
35
  - lib/css_zero/version.rb
36
+ - lib/generators/css_zero/add/USAGE
37
+ - lib/generators/css_zero/add/add_generator.rb
38
+ - lib/generators/css_zero/add/resources.yml
39
+ - lib/generators/css_zero/add/templates/app/assets/images/chevron-down.svg
40
+ - lib/generators/css_zero/add/templates/app/assets/images/loader-circle.svg
41
+ - lib/generators/css_zero/add/templates/app/assets/images/select-arrow.svg
42
+ - lib/generators/css_zero/add/templates/app/assets/images/x.svg
43
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css
44
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/alert.css
45
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/alert_dialog.css
46
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/badge.css
47
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css
48
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/card.css
49
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css
50
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css
51
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/progress.css
52
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css
53
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css
54
+ - lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_control_controller.js
55
+ - lib/generators/css_zero/install/USAGE
56
+ - lib/generators/css_zero/install/install_generator.rb
57
+ - lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css
40
58
  homepage: https://github.com/lazaronixon/css-zero
41
59
  licenses:
42
60
  - MIT
@@ -1,4 +0,0 @@
1
- html, body {
2
- background-color: var(--color-bg);
3
- color: var(--color-text);
4
- }
@@ -1,46 +0,0 @@
1
- .btn {
2
- align-items: center;
3
- background-color: var(--btn-background, var(--color-primary));
4
- border-radius: var(--btn-border-radius, var(--rounded-md));
5
- border: 1px solid var(--btn-border-color, transparent);
6
- color: var(--btn-color, var(--color-text-reversed));
7
- column-gap: var(--btn-gap, var(--size-2));
8
- cursor: pointer;
9
- display: inline-flex;
10
- font-size: var(--btn-font-size, var(--text-sm));
11
- font-weight: var(--btn-font-weight, var(--font-medium));
12
- justify-content: center;
13
- padding: var(--btn-padding, .5rem 1rem);
14
- text-align: center;
15
- white-space: nowrap;
16
-
17
- img:not([class]) {
18
- filter: var(--btn-icon-color, var(--color-filter-text-reversed));
19
- }
20
-
21
- &:disabled {
22
- opacity: var(--opacity-50);
23
- pointer-events: none;
24
- }
25
- }
26
-
27
- .btn--outline {
28
- --btn-background: transparent;
29
- --btn-border-color: var(--color-border);
30
- --btn-color: var(--color-text);
31
- --btn-icon-color: var(--color-filter-text);
32
- }
33
-
34
- .btn--plain {
35
- --btn-background: transparent;
36
- --btn-color: var(--color-text);
37
- --btn-icon-color: var(--color-filter-text);
38
- }
39
-
40
- .btn--positive {
41
- --btn-background: var(--color-positive);
42
- }
43
-
44
- .btn--negative {
45
- --btn-background: var(--color-negative);
46
- }
@@ -1,34 +0,0 @@
1
- .dialog {
2
- background-color: var(--dialog-background, var(--color-bg));
3
- border: 1px solid var(--dialog-border-color, var(--color-border));
4
- border-radius: var(--dialog-border-radius, var(--rounded-lg));
5
- box-shadow: var(--dialog-shadow, var(--shadow-lg));
6
- color: var(--dialog-color, var(--color-text));
7
- margin: auto; inline-size: 100%;
8
- max-inline-size: var(--dialog-size, var(--width-lg));
9
- padding: var(--dialog-padding, var(--size-6));
10
-
11
- &::backdrop {
12
- background-color: var(--dialog-backdrop-background, #000c);
13
- }
14
-
15
- /* Setup transition */
16
- &, &::backdrop {
17
- opacity: 0; transition: all var(--time-300) allow-discrete;
18
- }
19
-
20
- /* Fade in */
21
- &[open], &[open]::backdrop {
22
- opacity: 1
23
- }
24
-
25
- /* Fade out */
26
- @starting-style {
27
- &[open], &[open]::backdrop { opacity: 0; }
28
- }
29
-
30
- /* Responsiveness */
31
- @media (width <= 40rem) {
32
- border-radius: 0;
33
- }
34
- }
@@ -1,43 +0,0 @@
1
- .input {
2
- appearance: none;
3
- background-color: var(--input-background, transparent);
4
- border-radius: var(--input-border-radius, var(--rounded-md));
5
- border: 1px solid var(--input-border-color, var(--color-border));
6
- box-shadow: var(--input-shadow, var(--shadow-xs));
7
- font-size: var(--input-font-size, var(--text-sm));
8
- inline-size: 100%;
9
- padding: var(--input-padding, .5rem .75rem);
10
-
11
- &::file-selector-button {
12
- font-weight: var(--font-medium);
13
- margin-inline-end: var(--size-2);
14
- }
15
-
16
- &:is(textarea) {
17
- field-sizing: content;
18
- min-block-size: var(--input-lines, 4lh);
19
- resize: none;
20
- }
21
-
22
- &:is(select):not([multiple]) {
23
- background-image: var(--icon-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(113,113,122)' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E"));
24
- background-position: center right var(--icon-chevron-padding, .75rem);
25
- background-size: 1rem auto;
26
- background-repeat: no-repeat;
27
- }
28
-
29
- &:disabled {
30
- cursor: not-allowed;
31
- opacity: var(--opacity-50);
32
- }
33
-
34
- &::placeholder {
35
- color: var(--color-text-subtle);
36
- }
37
- }
38
-
39
- [type="checkbox"], [type="radio"] {
40
- accent-color: var(--color-primary);
41
- height: var(--check-size, var(--size-4));
42
- width: var(--check-size, var(--size-4));
43
- }
@@ -1,4 +0,0 @@
1
- .separator {
2
- border-block-start: 1px var(--separator-style, solid) var(--separator-color, var(--color-border));
3
- inline-size: 100%;
4
- }