You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, Bricks can only support a uniform styling of text within a TextNode. However in Figma, you can apply different styles to different sections of the TextNodes. Therefore, we should add support for having multiple styles within a single Figma TextNode
Styles to support:
CSS:
fontSize
fontName
fontWeight
textDecoration
textCase
lineHeight
letterSpacing
fills
textStyleId
fillStyleId
listOptions
indentation
hyperlink
Tailwind CSS
fontSize
fontName
fontWeight
textDecoration
textCase
lineHeight
letterSpacing
fills
textStyleId
fillStyleId
listOptions
indentation
hyperlink
Default styles map
If there are multiple text styles within a text node, here are the default styles to use for the outermost <div>:
fontSize: font-size: <the font size with the longest length>;
fontName: font-family: <the font with the longest length>;
Inside the <div>, for each different segment of text style, we wrap it in a <span> with the overriding styles.
Todos
Modify getCssAttributes() in core/src/design/adapter/figma/adapter.ts so that it generates default styles if style === figma.mixed. For example:
// font sizeif(figmaNode.fontSize!==figma.mixed){attributes["font-size"]=`${figmaNode.fontSize}px`;}else{// add default font size here according to the default styles map above}
Modify getTextProp() in core/src/code/generator/html/generator.ts so that we generate nested <span>s for each overriding style.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, Bricks can only support a uniform styling of text within a TextNode. However in Figma, you can apply different styles to different sections of the TextNodes. Therefore, we should add support for having multiple styles within a single Figma TextNode
Styles to support:
lineHeighttextStyleIdfillStyleIdlineHeighttextStyleIdfillStyleIdDefault styles map
If there are multiple text styles within a text node, here are the default styles to use for the outermost
<div>
:font-size: <the font size with the longest length>;
font-family: <the font with the longest length>;
font-weight: "normal";
(i.e. Regular font)font-style: "normal";
text-transform: "none";
line-height: normal;
letter-spacing: normal;
Inside the
<div>
, for each different segment of text style, we wrap it in a<span>
with the overriding styles.Todos
getCssAttributes()
incore/src/design/adapter/figma/adapter.ts
so that it generates default styles ifstyle === figma.mixed
. For example:getTextProp()
incore/src/code/generator/html/generator.ts
so that we generate nested<span>
s for each overriding style.The text was updated successfully, but these errors were encountered: