SlateComponents to decouple styling #295
Replies: 2 comments
-
|
@udecode/dev @Hideman85 do you have any reference for the provider pattern? How would you tackle that with our current styling system: overridable default styles Fluent UI styling pattern |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Let's track this in #363 |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Slate Components
Package:
@udecode/slate-plugins-componentsIn the current state, you can pass a custom component using the
componentoption of each plugin.We also want to let people create slate "design system components" inside a single package: material-ui, antd,.. But it would be cumbersome to manually add the provided components to the options of each plugin.
Solution:
<SlateComponents components={slateComponents} />provider.options.componentif defineduseSlateComponent(pluginKey)if defined.divfor an element,spanfor a mark.Fluent Components
Package
@udecode/slate-plugins-components-fluentDependency:
@udecode/slate-plugins-componentsThese components support css-in-js using the
stylesprops.stylesoption from rendering plugins.slateComponents: minimal styling.slateStyledComponents: full styling.createSlateStyledComponents: (slateComponents: SlateComponents) => SlateComponentsto override the styles ofslateComponentsslateStyledComponents.SlateComponentsobject.Components having dependency can have their own package for bundle size.
See #283 #230
Styling with css
As a good practice, all the slate nodes should have (nested) class names, so anyone can style these without
slate-componentsor css-in-js solution.Beta Was this translation helpful? Give feedback.
All reactions