mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🐛 Fix problem with text and blank spaces
This commit is contained in:
parent
cc046555a3
commit
68e0b3e756
1 changed files with 4 additions and 6 deletions
|
@ -21,7 +21,8 @@
|
|||
base #js {:height height
|
||||
:width width
|
||||
:fontFamily "sourcesanspro"
|
||||
:display "flex"}]
|
||||
:display "flex"
|
||||
:whiteSpace "pre-wrap"}]
|
||||
(cond-> base
|
||||
(= valign "top") (obj/set! "alignItems" "flex-start")
|
||||
(= valign "center") (obj/set! "alignItems" "center")
|
||||
|
@ -45,18 +46,15 @@
|
|||
:verticalAlign "top"}))
|
||||
|
||||
(defn generate-paragraph-styles
|
||||
[shape data]
|
||||
[_shape data]
|
||||
(let [line-height (:line-height data 1.2)
|
||||
text-align (:text-align data "start")
|
||||
grow-type (:grow-type shape)
|
||||
|
||||
base #js {:fontSize (str (:font-size data (:font-size txt/default-text-attrs)) "px")
|
||||
:lineHeight (:line-height data (:line-height txt/default-text-attrs))
|
||||
:margin "inherit"}]
|
||||
(cond-> base
|
||||
(some? line-height) (obj/set! "lineHeight" line-height)
|
||||
(some? text-align) (obj/set! "textAlign" text-align)
|
||||
(= grow-type :auto-width) (obj/set! "whiteSpace" "pre"))))
|
||||
(some? text-align) (obj/set! "textAlign" text-align))))
|
||||
|
||||
(defn generate-text-styles
|
||||
([data]
|
||||
|
|
Loading…
Add table
Reference in a new issue