Is there a way to share styles between components #687
Replies: 2 comments
-
Hi 👋 (and thanks for opening a discussion instead of an issue 🙏) There are no global styles in Mint. You can create a component Centered {
property children : Array(Html) = []
style root {
justify-content: center;
flex-direction: column;
align-items: center;
display: flex;
padding: 5px;
font-family: "Open Sans";
font-weight: bold;
}
fun render : Html {
<div::root>
<{ children }>
</div>
}
} Then use it later: <Centered>
<button onClick={handleIncrement}>
"Click Me!"
</button>
<br/>
<{ Number.toString(val) }>
</Centered> |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
...to avoid repeating styles definitions, as in:
Beta Was this translation helpful? Give feedback.
All reactions