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
I found an interesting case from this repo => https://github.com/hanyang7427/SpaceX/blob/main/src/preDefine.ts
It's kinda painful when someone wants to create a custom-named predefined style and use it in some file. They need to define first, then export, and import. It takes effort.
So, let's improve by making a behavior similar to the web CSS. We can assume this custom predefined looks like a class name in web CSS.
Approach
Adding new props on OsmiProvider
let's store all the custom-named predefined style into provider to make it easy to access later.
notice that we can use container from style utilities directly on apply method. This will be easier other than you defined and import manually like below:
import globalStyles from '/globalStyles.ts'
apply(globalStyles.container)
The text was updated successfully, but these errors were encountered:
Background
I found an interesting case from this repo => https://github.com/hanyang7427/SpaceX/blob/main/src/preDefine.ts
It's kinda painful when someone wants to create a custom-named predefined style and use it in some file. They need to define first, then export, and import. It takes effort.
So, let's improve by making a behavior similar to the web CSS. We can assume this custom predefined looks like a class name in web CSS.
Approach
Adding new props on
OsmiProvider
let's store all the custom-named predefined style into provider to make it easy to access later.
Usage
notice that we can use
container
from style utilities directly on apply method. This will be easier other than you defined and import manually like below:The text was updated successfully, but these errors were encountered: