Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: styling implementation #14

Merged
merged 2 commits into from
Aug 26, 2022
Merged

refactor: styling implementation #14

merged 2 commits into from
Aug 26, 2022

Conversation

ronimizy
Copy link
Owner

What

Refactored implementation of applying styles. Core idea was the cascading styles, so the styles from higher level components would be applied to lower level components. Pervious implementation had a limitation of priority of top level styles over lower level styles, which is unfortunate, because component specific rules should have a higher priority. Issue could be observed on containers.

Why

That limitation came from a structure of styling components, it was an unordered composition, meaning the higher styling component in composition - the higher priority is has.

How

The composition is now ordered! There is now only one styling component type, which is located on top of the component composition (or not, if there was no styling applied). Now, when you want to apply style to component composition A, you will create a new styling component instance with new style applied to an old style with component wrapped in composition A's styling component, if composition A does not have a styling component - the new instance will be created.

@ronimizy ronimizy added bug Something isn't working refactoring It works, but it can be better area-core Item associated with core logic labels Aug 25, 2022
@ronimizy ronimizy self-assigned this Aug 25, 2022
@ronimizy ronimizy merged commit 054d947 into master Aug 26, 2022
@ronimizy ronimizy deleted the refactor/styling branch August 26, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core Item associated with core logic bug Something isn't working refactoring It works, but it can be better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants