[Slider] Experiments for base component #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is experimenting with extracting the styling from the base component. In order for this to work, the base component has to somehow know which classes should go where. We can have two different approaches on this.
Relaying on slots (inner components) structure inside the classes as a contract. This means that the styled components will organize the classes into object containing the different parts of the component, for example root, thumb, rail, track etc. It will take care of appending the correct classes based on the props provided. The base component will only know that each classes should be append to the correct inner component.
Relaying on
components
prop, where the styled components can configure each of the components to be already styled, so that the base component will just render whatever is inside the components prop. This could go well with utilities likestyled
where each component can be styled separately. One downside is that the styled HOC will need to know which components should be used internally in the base component.