This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Dae Hyuk Yoon
Posted Aug 15 - Read on Facebook

How do I set CSS properties of text in Framer? I could only find examples of fontSize, textAlign, lineHeight in the examples section.

3 Comments

Alex Hazel

myLayer.style = {
"whateverCSSPropertyYouWantToUse": "value"
"whateverCSSPropertyYouWantToUse": "value"
"whateverCSSPropertyYouWantToUse": "value"
"whateverCSSPropertyYouWantToUse": "value"
}

myLayer.style = {
"line-height": "2.2"
"font-size": "18px"
"padding-left": "12px"
"background-color": "teal"
}

Dae Hyuk Yoon

Great! Thanks Alex.

Alex Hazel

"Some css properties are now directly exposed on the layer (without having to go through .style) like backgroundColor"

Looks like they are allowing you to style layers directly with some of the more common CSS properties that people constantly use. But it is a very short list. The rest of the CSS is handled exactly how I posted. But you might want to read the "readme.md" file on Github to see what was added and changed with the new version.

https://github.com/koenbok/Framer

Read the entire post on Facebook