layered-ui-rails 0.6.0 → 0.7.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 +4 -4
- data/.claude/skills/layered-ui-rails/SKILL.md +4 -2
- data/.claude/skills/layered-ui-rails/references/CSS.md +7 -5
- data/CHANGELOG.md +16 -0
- data/README.md +0 -2
- data/app/assets/tailwind/layered/ui/styles.css +22 -2
- data/app/views/layouts/layered_ui/_panel.html.erb +10 -2
- data/lib/generators/layered/ui/create_overrides_generator.rb +9 -3
- data/lib/layered/ui/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b538d1b28b8718c6bcbaa3e9e21b8294b2e0556ca869433245d1e587ac7679a9
|
|
4
|
+
data.tar.gz: 775ec4083eb6e729eee0aa2c83c3ed5001fe258dd79c78ed476e103910797dda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bfd719cd045e9ceb2a065c8ab8de722f6bc9187e541580dd39e7f11bd3672aae14628b04252fd0dc0de44dcc0656cb61df01954c210227a611a6bf4c5d187e1e
|
|
7
|
+
data.tar.gz: 4ac05f4a41d0cb312d67f0337136f77a3eecfb944089ce65be0c78fe15fe7a326edd7f06fa790c0b5cec1cb57cb2275c99d14d39015be3288ef35da7dffd706e
|
|
@@ -150,7 +150,7 @@ All controllers use the `l-ui--` namespace and are auto-registered via importmap
|
|
|
150
150
|
|
|
151
151
|
## Theming
|
|
152
152
|
|
|
153
|
-
Override CSS custom properties after the engine import. Values are space-separated HSL channels (
|
|
153
|
+
Override CSS custom properties after the engine import. Values are space-separated HSL channels (e.g. `220 80% 55%`, or `0 0% 100%` for white). Keywords and hex/rgb won't work - tokens are wrapped in `hsl()` when consumed. A converter such as https://colorpicker.dev/ can help translate hex/rgb values.
|
|
154
154
|
|
|
155
155
|
```css
|
|
156
156
|
@import "./layered_ui";
|
|
@@ -170,7 +170,9 @@ Key tokens: `--accent`, `--accent-foreground`, `--background`, `--foreground`, `
|
|
|
170
170
|
|
|
171
171
|
Place files in `app/assets/images/layered_ui/` to replace engine defaults:
|
|
172
172
|
|
|
173
|
-
`logo_light.svg`, `logo_dark.svg`, `icon_light.svg`, `icon_dark.svg`, `apple_touch_icon.png
|
|
173
|
+
`logo_light.svg`, `logo_dark.svg`, `icon_light.svg`, `icon_dark.svg`, `apple_touch_icon.png`.
|
|
174
|
+
|
|
175
|
+
The panel toggle button uses an inline SVG that inherits `currentColor`. Recolor it by overriding the `--button-primary-icon` Tier 2 token, or replace the image by setting both `@l_ui_panel_icon_light_url` and `@l_ui_panel_icon_dark_url` (per-request).
|
|
174
176
|
|
|
175
177
|
## Optional integrations
|
|
176
178
|
|
|
@@ -222,8 +222,9 @@ WCAG 2.2 AA table pattern:
|
|
|
222
222
|
.l-ui-panel__button Floating action button
|
|
223
223
|
.l-ui-panel__button--dragging During drag
|
|
224
224
|
.l-ui-panel__button--snapping Snapping to edge
|
|
225
|
-
.l-ui-panel__icon
|
|
226
|
-
.l-ui-panel__icon--
|
|
225
|
+
.l-ui-panel__icon Panel button inline SVG icon
|
|
226
|
+
.l-ui-panel__icon--light Panel button icon (light, for custom image override)
|
|
227
|
+
.l-ui-panel__icon--dark Panel button icon (dark, for custom image override)
|
|
227
228
|
.l-ui-panel__resize-handle Desktop resize handle
|
|
228
229
|
.l-ui-panel__header Panel header
|
|
229
230
|
.l-ui-panel__header-heading Panel title
|
|
@@ -282,7 +283,7 @@ WCAG 2.2 AA table pattern:
|
|
|
282
283
|
|
|
283
284
|
## Theming tokens
|
|
284
285
|
|
|
285
|
-
All color values are space-separated HSL channels (e.g. `220 80% 55%`). Override after importing the engine CSS.
|
|
286
|
+
All color values are space-separated HSL channels (e.g. `220 80% 55%`, or `0 0% 100%` for white). Override after importing the engine CSS. Keywords and hex/rgb won't work - tokens are wrapped in `hsl()` when consumed. A converter such as https://colorpicker.dev/ can help translate hex/rgb values.
|
|
286
287
|
|
|
287
288
|
Tier 1 - Accent (quick branding):
|
|
288
289
|
```
|
|
@@ -301,7 +302,8 @@ Tier 2 - Full palette (override individually as needed):
|
|
|
301
302
|
--surface Card/surface background
|
|
302
303
|
--surface-highlighted Highlighted surface
|
|
303
304
|
--button-primary-bg Primary button background (defaults to --accent)
|
|
304
|
-
--button-primary-text Primary button
|
|
305
|
+
--button-primary-text Primary button text (defaults to --accent-foreground)
|
|
306
|
+
--button-primary-icon Icon color on filled icon buttons (defaults to --button-primary-text)
|
|
305
307
|
--danger Danger/error color
|
|
306
308
|
--danger-light Light danger background
|
|
307
309
|
--danger-text Danger text color
|
|
@@ -315,4 +317,4 @@ Tier 2 - Full palette (override individually as needed):
|
|
|
315
317
|
--header-height Header height (default 63px)
|
|
316
318
|
```
|
|
317
319
|
|
|
318
|
-
Override --button-primary-text when your accent color needs a different text/icon color on buttons (e.g. a pink accent with white button text in dark mode).
|
|
320
|
+
Override --button-primary-text when your accent color needs a different text/icon color on buttons (e.g. a pink accent with white button text in dark mode). Override --button-primary-icon instead when only the icon color should change.
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. This project follows [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [0.7.0] - 2026-04-23
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `--button-primary-icon` Tier 2 token for filled icon buttons (e.g. `l-ui-panel__button`, `l-ui-scroll-to-bottom`). Defaults to `--button-primary-text`; override to recolor icons independently of button text.
|
|
10
|
+
- Inline SVG default for the panel toggle button icon - inherits `currentColor` so it picks up `--button-primary-icon`. Per-request `@l_ui_panel_icon_light_url` / `@l_ui_panel_icon_dark_url` still replace the default image, and each theme falls back to the inline SVG independently when its variable is unset.
|
|
11
|
+
- Documentation of the HSL-channel format for theme tokens (space-separated channels such as `220 80% 55%`) in `SKILL.md`, `references/CSS.md`, and the overrides generator, with a pointer to a hex/rgb converter.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `l-ui-scroll-to-bottom` now bakes the chevron-down icon into CSS via `mask-image` (with `-webkit-mask` prefixes and a URL-encoded SVG for Safari compatibility) and colours it with `--button-primary-icon`. Host markup is a plain empty `<button class="l-ui-scroll-to-bottom" aria-label="...">` - no inner `<svg>`/`<img>` required.
|
|
16
|
+
|
|
17
|
+
### Removed
|
|
18
|
+
|
|
19
|
+
- Static-file panel icon overrides (`panel_icon_light.svg`, `panel_icon_dark.svg` in `app/assets/images/layered_ui/`). Use `@l_ui_panel_icon_light_url` / `@l_ui_panel_icon_dark_url` instance variables to supply a custom image.
|
|
20
|
+
|
|
5
21
|
## [0.6.0] - 2026-04-19
|
|
6
22
|
|
|
7
23
|
### Added
|
data/README.md
CHANGED
|
@@ -150,8 +150,6 @@ Replace the defaults by placing files with the same names in `app/assets/images/
|
|
|
150
150
|
| `icon_light.svg` | Favicon and header icon (light theme) |
|
|
151
151
|
| `icon_dark.svg` | Favicon and header icon (dark theme) |
|
|
152
152
|
| `apple_touch_icon.png` | Apple touch icon |
|
|
153
|
-
| `panel_icon_light.svg` | Panel toggle button (light theme) |
|
|
154
|
-
| `panel_icon_dark.svg` | Panel toggle button (dark theme) |
|
|
155
153
|
|
|
156
154
|
layered-ui-rails uses two patterns for per-request overrides:
|
|
157
155
|
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
--surface-highlighted: 0 0% 91%;
|
|
62
62
|
--button-primary-bg: var(--accent);
|
|
63
63
|
--button-primary-text: var(--accent-foreground);
|
|
64
|
+
--button-primary-icon: var(--button-primary-text);
|
|
64
65
|
--danger: 0 72% 38%;
|
|
65
66
|
--danger-light: 0 100% 97%;
|
|
66
67
|
--danger-text: 0 72% 35%;
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
--surface-highlighted: 0 0% 16%;
|
|
90
91
|
--button-primary-bg: var(--accent);
|
|
91
92
|
--button-primary-text: var(--accent-foreground);
|
|
93
|
+
--button-primary-icon: var(--button-primary-text);
|
|
92
94
|
--danger: 0 85% 60%;
|
|
93
95
|
--danger-light: 0 93% 15%;
|
|
94
96
|
--danger-text: 0 85% 64%;
|
|
@@ -166,6 +168,7 @@
|
|
|
166
168
|
--color-surface-highlighted: hsl(var(--surface-highlighted));
|
|
167
169
|
--color-button-primary-bg: hsl(var(--button-primary-bg));
|
|
168
170
|
--color-button-primary-text: hsl(var(--button-primary-text));
|
|
171
|
+
--color-button-primary-icon: hsl(var(--button-primary-icon));
|
|
169
172
|
--color-danger: hsl(var(--danger));
|
|
170
173
|
--color-danger-light: hsl(var(--danger-light));
|
|
171
174
|
--color-danger-text: hsl(var(--danger-text));
|
|
@@ -1384,7 +1387,7 @@ pre.l-ui-surface {
|
|
|
1384
1387
|
z-40
|
|
1385
1388
|
cursor-pointer
|
|
1386
1389
|
bg-button-primary-bg
|
|
1387
|
-
text-button-primary-
|
|
1390
|
+
text-button-primary-icon
|
|
1388
1391
|
rounded-full
|
|
1389
1392
|
focus-ring
|
|
1390
1393
|
transition-all;
|
|
@@ -1411,6 +1414,10 @@ pre.l-ui-surface {
|
|
|
1411
1414
|
opacity-0 pointer-events-none;
|
|
1412
1415
|
}
|
|
1413
1416
|
|
|
1417
|
+
.l-ui-panel__icon {
|
|
1418
|
+
@apply w-7 h-7;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1414
1421
|
.l-ui-panel__icon--light {
|
|
1415
1422
|
@apply block
|
|
1416
1423
|
dark:invert-0;
|
|
@@ -1655,12 +1662,25 @@ pre.l-ui-surface {
|
|
|
1655
1662
|
ml-auto mr-0 -mt-9 h-9 w-9
|
|
1656
1663
|
rounded-full
|
|
1657
1664
|
cursor-pointer
|
|
1658
|
-
bg-button-primary-bg text-button-primary-
|
|
1665
|
+
bg-button-primary-bg text-button-primary-icon
|
|
1659
1666
|
focus-ring
|
|
1660
1667
|
opacity-0 pointer-events-none
|
|
1661
1668
|
transition-opacity duration-200;
|
|
1662
1669
|
}
|
|
1663
1670
|
|
|
1671
|
+
.l-ui-scroll-to-bottom::before {
|
|
1672
|
+
content: "";
|
|
1673
|
+
@apply block w-4 h-4 bg-button-primary-icon;
|
|
1674
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
|
|
1675
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
|
|
1676
|
+
-webkit-mask-size: contain;
|
|
1677
|
+
mask-size: contain;
|
|
1678
|
+
-webkit-mask-repeat: no-repeat;
|
|
1679
|
+
mask-repeat: no-repeat;
|
|
1680
|
+
-webkit-mask-position: center;
|
|
1681
|
+
mask-position: center;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1664
1684
|
.l-ui-scroll-to-bottom[data-visible] {
|
|
1665
1685
|
@apply
|
|
1666
1686
|
opacity-100 pointer-events-auto;
|
|
@@ -65,7 +65,15 @@
|
|
|
65
65
|
data-action="click->l-ui--panel-button#toggle mousedown->l-ui--panel-button#startDrag touchstart->l-ui--panel-button#startDrag"
|
|
66
66
|
data-l-ui--panel-target="actionButton"
|
|
67
67
|
>
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
<% if @l_ui_panel_icon_light_url.present? %>
|
|
69
|
+
<%= image_tag(@l_ui_panel_icon_light_url, alt: "", class: "l-ui-icon--lg l-ui-panel__icon--light", aria: { hidden: true }) %>
|
|
70
|
+
<% else %>
|
|
71
|
+
<svg class="l-ui-panel__icon l-ui-panel__icon--light" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
|
|
72
|
+
<% end %>
|
|
73
|
+
<% if @l_ui_panel_icon_dark_url.present? %>
|
|
74
|
+
<%= image_tag(@l_ui_panel_icon_dark_url, alt: "", class: "l-ui-icon--lg l-ui-panel__icon--dark", aria: { hidden: true }) %>
|
|
75
|
+
<% else %>
|
|
76
|
+
<svg class="l-ui-panel__icon l-ui-panel__icon--dark" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
|
|
77
|
+
<% end %>
|
|
70
78
|
</button>
|
|
71
79
|
</div>
|
|
@@ -26,8 +26,10 @@ module Layered
|
|
|
26
26
|
* This file is NOT overwritten by the install generator, so your
|
|
27
27
|
* changes are preserved when you upgrade layered-ui-rails.
|
|
28
28
|
*
|
|
29
|
-
* Values are HSL channels
|
|
30
|
-
*
|
|
29
|
+
* Values are space-separated HSL channels (e.g. `220 80% 55%`,
|
|
30
|
+
* or `0 0% 100%` for white). Keywords and hex/rgb won't work -
|
|
31
|
+
* tokens are wrapped in `hsl()` when consumed. A converter such
|
|
32
|
+
* as https://colorpicker.dev/ can help translate hex/rgb values.
|
|
31
33
|
*/
|
|
32
34
|
|
|
33
35
|
/* ----------------------------------------------------------------
|
|
@@ -38,7 +40,9 @@ module Layered
|
|
|
38
40
|
*
|
|
39
41
|
* If your accent color needs a different text/icon color on
|
|
40
42
|
* buttons (e.g. a pink accent with white button text in dark
|
|
41
|
-
* mode), override --button-primary-text in Tier 2 below.
|
|
43
|
+
* mode), override --button-primary-text in Tier 2 below. To
|
|
44
|
+
* recolor only the icon (leaving button text unchanged),
|
|
45
|
+
* override --button-primary-icon instead.
|
|
42
46
|
* ---------------------------------------------------------------- */
|
|
43
47
|
|
|
44
48
|
:root {
|
|
@@ -69,6 +73,7 @@ module Layered
|
|
|
69
73
|
--surface-highlighted: 0 0% 91%;
|
|
70
74
|
--button-primary-bg: var(--accent);
|
|
71
75
|
--button-primary-text: var(--accent-foreground);
|
|
76
|
+
--button-primary-icon: var(--button-primary-text);
|
|
72
77
|
--danger: 0 72% 38%;
|
|
73
78
|
--danger-light: 0 100% 97%;
|
|
74
79
|
--danger-text: 0 72% 35%;
|
|
@@ -91,6 +96,7 @@ module Layered
|
|
|
91
96
|
--surface-highlighted: 0 0% 16%;
|
|
92
97
|
--button-primary-bg: var(--accent);
|
|
93
98
|
--button-primary-text: var(--accent-foreground);
|
|
99
|
+
--button-primary-icon: var(--button-primary-text);
|
|
94
100
|
--danger: 0 85% 60%;
|
|
95
101
|
--danger-light: 0 93% 15%;
|
|
96
102
|
--danger-text: 0 85% 64%;
|
data/lib/layered/ui/version.rb
CHANGED