mirror of
https://github.com/penpot/penpot.git
synced 2025-07-29 03:07:29 +02:00
commit
fe1a433440
8 changed files with 82 additions and 93 deletions
|
@ -68,6 +68,12 @@
|
|||
editing-text* (mf/use-state false)
|
||||
editing-text? (deref editing-text*)
|
||||
|
||||
opacity?
|
||||
(and (not gradient-color?)
|
||||
(not multiple-colors?)
|
||||
(not library-color?)
|
||||
(not disable-opacity))
|
||||
|
||||
on-focus
|
||||
(mf/use-fn
|
||||
(mf/deps on-focus)
|
||||
|
@ -187,6 +193,7 @@
|
|||
:ref dref}
|
||||
[:span {:class (stl/css :color-info)}
|
||||
[:span {:class (stl/css-case :color-name-wrapper true
|
||||
:no-opacity (not opacity?)
|
||||
:library-name-wrapper library-color?
|
||||
:editing editing-text?
|
||||
:gradient-name-wrapper gradient-color?)}
|
||||
|
@ -238,16 +245,13 @@
|
|||
:on-blur on-blur
|
||||
:on-change handle-value-change}]])]
|
||||
|
||||
(when (and (not gradient-color?)
|
||||
(not multiple-colors?)
|
||||
(not library-color?))
|
||||
|
||||
(when opacity?
|
||||
[:div {:class (stl/css :opacity-element-wrapper)}
|
||||
[:span {:class (stl/css :icon-text)}
|
||||
"%"]
|
||||
[:> numeric-input* {:value (-> color :opacity opacity->string)
|
||||
:className (stl/css :opacity-input)
|
||||
:placeholder (tr "settings.multiple")
|
||||
:placeholder "--"
|
||||
:select-on-focus select-on-focus
|
||||
:on-focus on-focus
|
||||
:on-blur on-blur
|
||||
|
@ -263,14 +267,7 @@
|
|||
:on-click handle-select}
|
||||
i/move-refactor])]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; OLD CSS
|
||||
[:div.row-flex.color-data {:title title
|
||||
:class (dom/classnames
|
||||
:dnd-over-top (= (:over dprops) :top)
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
border-radius: $br-8 0 0 $br-8;
|
||||
padding: 0;
|
||||
margin-right: 0;
|
||||
&.no-opacity {
|
||||
border-radius: $br-8;
|
||||
}
|
||||
.color-bullet-wrapper {
|
||||
height: $s-28;
|
||||
padding: 0 $s-2 0 $s-8;
|
||||
|
@ -115,6 +118,7 @@
|
|||
width: $s-60;
|
||||
border-radius: 0 $br-8 $br-8 0;
|
||||
.opacity-input {
|
||||
padding: 0;
|
||||
border-radius: 0 $br-8 $br-8 0;
|
||||
min-width: $s-28;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue