keystone_ui 0.13.0 → 0.14.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 903dfcff87cb63fce06692a39fb26b73af673f562f28f3b3ebf72b13b5280642
4
- data.tar.gz: 7db5a26e387cc0c2b11a311c70e967ec977f5b1636c6d38bf8a42b28d5ffbd9a
3
+ metadata.gz: 19985a6e534c22e09228551a7b42fdce26c07108512510302e0943d78bbbd220
4
+ data.tar.gz: 2ab28d0ba73793eada71a4164a876c491c11c48fe34e1e779cd4e47b4e0c5874
5
5
  SHA512:
6
- metadata.gz: 574997b044dfcbb23b6aad3e74065b041d549d1be5a8629f5c08f792720f1fda5d988340516caa581f80c1455fcc3a32080174b8056f06a41c4fa58423236cbb
7
- data.tar.gz: 30a7877baf982039cff72b9c8ad0dc879a8fdbc8362d8ec15cec9b7b48964aa8dc1786494b25e3c131e1c28a2c000054c33998011ea41b111da749e1863518f3
6
+ metadata.gz: 3977daa450ed35f50d903ed792260ba8559b52826aca4882941f1c73185dd6b5b99f3fbb007ae7d7b0fc37d866bd0201f162ad979dd4cf409c1f944a34165d4c
7
+ data.tar.gz: 4598172f5ab465a6c4e81a6b16f1e55206b93a2865598dbbc9d27f49b1bcd7ff029aff2ac104cc9f532bb3774a971324066b83052f244bc1a40848df552ea781
@@ -3,7 +3,7 @@
3
3
  module KeystoneUi
4
4
  class ThemeChoice
5
5
  COOKIE = "keystone_theme"
6
- MODES = %w[light dark system].freeze
6
+ MODES = %w[light dark system custom].freeze
7
7
 
8
8
  def initialize(mode, supplied: nil)
9
9
  @mode = mode
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KeystoneUi
4
- VERSION = "0.13.0"
4
+ VERSION = "0.14.0"
5
5
  end
@@ -70,10 +70,12 @@ holds the catalog.
70
70
  Tailwind's stock `gray-*` and `zinc-*` neutrals, or fixed status colors such
71
71
  as green and amber, directly. Changing the defaults belongs to the install
72
72
  local.
73
- - **Light, dark and system themes.** Every component has dark-mode styling. The
74
- theme is chosen in this order: the user's choice stored in a cookie, then a
75
- mode another gem supplies, then light. System leaves the page to follow the
76
- operating system.
73
+ - **Light, dark, system and custom themes.** Every component has dark-mode
74
+ styling. The theme is chosen in this order: the user's choice stored in a
75
+ cookie, then a mode another gem supplies, then light. System leaves the page
76
+ to follow the operating system. Custom marks the page for a palette another
77
+ gem defines. The theme toggle does not offer it, so a page reaches it when
78
+ another gem supplies it.
77
79
  - **Tailwind classes are static strings.** Class names are never interpolated,
78
80
  so Tailwind's scanner can find them. Widths and heights that depend on data,
79
81
  such as a progress bar or a bucket's fill, are set with an inline style
@@ -20,7 +20,8 @@ built on ViewComponent; hook it in before building any screen with those helpers
20
20
  to the layout's `<html>` tag. Safe to re-run.
21
21
  - `KeystoneUi.configure` — a block yielding the configuration: `accent` and
22
22
  `surface` (palette names, `:blue` and `:zinc` unless set),
23
- `theme_mode_supplier` (a callable that supplies a light, dark or system mode),
23
+ `theme_mode_supplier` (a callable that supplies a light, dark, system or
24
+ custom mode),
24
25
  and the `tailwind_imports` and `tailwind_sources` lists (extra CSS files and
25
26
  scan paths added to the Tailwind build).
26
27
 
@@ -61,7 +62,7 @@ built on ViewComponent; hook it in before building any screen with those helpers
61
62
  `registerControllers(application)`.
62
63
  - `app/views/layouts/application.html.erb` — adds
63
64
  `<%= keystone_theme_attributes %>` inside the `<html` tag, which writes the
64
- light or dark mode onto the page.
65
+ light, dark or custom mode onto the page.
65
66
 
66
67
  Read its output for two warnings:
67
68
 
@@ -139,10 +140,14 @@ built on ViewComponent; hook it in before building any screen with those helpers
139
140
  reads the palette choice. Keystone UI stores the names and changes no color
140
141
  from them, because colors come from the CSS custom properties in step 6.
141
142
  - `theme_mode_supplier` — a callable that receives the view and returns
142
- `"light"`, `"dark"` or `"system"`. It supplies the mode when the user has
143
- not picked one with the theme toggle, since the `keystone_theme` cookie that
144
- the toggle writes takes precedence. Any other return value, or no supplier,
145
- falls back to light.
143
+ `"light"`, `"dark"`, `"system"`, `"custom"` or `nil`. It supplies the mode
144
+ when the user has not picked one with the theme toggle, since the
145
+ `keystone_theme` cookie that the toggle writes takes precedence. Any other
146
+ return value, or no supplier, falls back to light.
147
+ - A supplied `"custom"` marks the layout's `<html>` tag
148
+ `data-theme="custom"`. The theme toggle does not offer custom, so only a
149
+ supplier sets it. Ask the developer which gem or code supplies custom and
150
+ its colors before returning it.
146
151
  - `tailwind_imports` and `tailwind_sources` — lists to append to, never
147
152
  assign. Each import becomes an `@import` line and each source becomes an
148
153
  `@source` line in `keystone_source.css` on the next boot. They are for
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keystone_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.0
18
+ version: 0.3.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.0
25
+ version: 0.3.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: view_component
28
28
  requirement: !ruby/object:Gem::Requirement