mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -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
|
base #js {:height height
|
||||||
:width width
|
:width width
|
||||||
:fontFamily "sourcesanspro"
|
:fontFamily "sourcesanspro"
|
||||||
:display "flex"}]
|
:display "flex"
|
||||||
|
:whiteSpace "pre-wrap"}]
|
||||||
(cond-> base
|
(cond-> base
|
||||||
(= valign "top") (obj/set! "alignItems" "flex-start")
|
(= valign "top") (obj/set! "alignItems" "flex-start")
|
||||||
(= valign "center") (obj/set! "alignItems" "center")
|
(= valign "center") (obj/set! "alignItems" "center")
|
||||||
|
@ -45,18 +46,15 @@
|
||||||
:verticalAlign "top"}))
|
:verticalAlign "top"}))
|
||||||
|
|
||||||
(defn generate-paragraph-styles
|
(defn generate-paragraph-styles
|
||||||
[shape data]
|
[_shape data]
|
||||||
(let [line-height (:line-height data 1.2)
|
(let [line-height (:line-height data 1.2)
|
||||||
text-align (:text-align data "start")
|
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")
|
base #js {:fontSize (str (:font-size data (:font-size txt/default-text-attrs)) "px")
|
||||||
:lineHeight (:line-height data (:line-height txt/default-text-attrs))
|
:lineHeight (:line-height data (:line-height txt/default-text-attrs))
|
||||||
:margin "inherit"}]
|
:margin "inherit"}]
|
||||||
(cond-> base
|
(cond-> base
|
||||||
(some? line-height) (obj/set! "lineHeight" line-height)
|
(some? line-height) (obj/set! "lineHeight" line-height)
|
||||||
(some? text-align) (obj/set! "textAlign" text-align)
|
(some? text-align) (obj/set! "textAlign" text-align))))
|
||||||
(= grow-type :auto-width) (obj/set! "whiteSpace" "pre"))))
|
|
||||||
|
|
||||||
(defn generate-text-styles
|
(defn generate-text-styles
|
||||||
([data]
|
([data]
|
||||||
|
|
Loading…
Add table
Reference in a new issue