Get the styles of a component from the theme's design token #5299
dylan-westbury
started this conversation in
Feature request
Replies: 2 comments
-
Hi @dylan-westbury, although it's a good idea. not sure if we should do that. cause it contains styling specific to Input which is designed for NB Input. What I would suggest is to pass a second argument component theme to the factory function which you can copy from NativeBase |
Beta Was this translation helpful? Give feedback.
0 replies
-
converting this to feature request discussion. |
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
-
Description
Is it possible to get the styles of a component from the theme's design token?
For example, below the user is setting styles for the input below.
Where it would make more sense to get the styles from the theme's design token for a TextInput (e.g. outlined text input variant).
I have tried tried useToken, but I can't actually access the styles I believe
const [token] = useToken('components', ['Input.variants.filled']);
Problem Statement
If it doesn't already exist, it should exist so custom components can refer to the styling of the theme, so when the theme does update the component will update, as opposed to updating the individual component .
Proposed Solution or API
const [styles] = useToken('components', ['Input.variants.filled.baseStyles']);
Alternatives
No response
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions