mirror of
https://github.com/penpot/penpot.git
synced 2026-11-27 21:57:52 +00:00
💄 Draw the reading options box only in its dropdown
The reading options of the whole text, in the Furigana group, sit among the other rows of the language view and need no box. The box now marks them only when the ⋮ button of a selection opens them below its reading input. AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
11e1647b7f
commit
90f857c697
@ -545,16 +545,18 @@
|
||||
|
||||
(mf/defc ruby-presentation-grid*
|
||||
"Size and side, then alignment and overhang of the readings, two to a
|
||||
row in a light box. Side names both writing modes, so it reads the same
|
||||
in horizontal and vertical text."
|
||||
[{:keys [values on-change on-blur class]}]
|
||||
row. `boxed` draws them in a light box, to set them apart from the rows
|
||||
around them when a button opens them. Side names both writing modes, so
|
||||
it reads the same in horizontal and vertical text."
|
||||
[{:keys [values on-change on-blur class boxed]}]
|
||||
(let [props (mf/props {:values values :on-change on-change :on-blur on-blur})
|
||||
options (mf/with-memo []
|
||||
{:ruby-size (ruby-size-options tr)
|
||||
:ruby-side (ruby-side-options tr)
|
||||
:ruby-align (ruby-align-options tr)
|
||||
:ruby-overhang (ruby-overhang-options tr)})]
|
||||
[:div {:class [class (stl/css :ruby-presentation-grid)]
|
||||
[:div {:class [class (stl/css-case :ruby-presentation-grid true
|
||||
:ruby-presentation-grid-boxed boxed)]
|
||||
:data-testid "ruby-presentation-options"}
|
||||
[:> ruby-presentation-cell* (mf/spread-props props {:attr :ruby-size
|
||||
:label (tr "workspace.options.text-options.ruby-size")
|
||||
@ -591,4 +593,5 @@
|
||||
(when ^boolean open?
|
||||
[:> ruby-presentation-grid* {:values values
|
||||
:on-change on-change
|
||||
:on-blur on-blur}])]))
|
||||
:on-blur on-blur
|
||||
:boxed true}])]))
|
||||
|
||||
@ -123,11 +123,15 @@
|
||||
color: var(--color-foreground-error);
|
||||
}
|
||||
|
||||
// The reading options, two to a row in a light box.
|
||||
// The reading options, two to a row.
|
||||
.ruby-presentation-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--sp-s) var(--sp-xs);
|
||||
}
|
||||
|
||||
// In a light box when a button opens them below the reading input.
|
||||
.ruby-presentation-grid-boxed {
|
||||
padding: var(--sp-s);
|
||||
border: $b-1 solid var(--color-background-quaternary);
|
||||
border-radius: $br-8;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user