-
Notifications
You must be signed in to change notification settings - Fork 109
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
"Traitify" the Style
struct
#568
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicoburns
added
enhancement
New feature or request
usability
Make the library more comfortable to use
code quality
Make the code cleaner or prettier.
labels
Oct 22, 2023
nicoburns
force-pushed
the
traitify-style
branch
from
October 22, 2023 19:55
0dec3a3
to
11e7840
Compare
@vkurchatkin-miro How does this design for traitifying |
nicoburns
force-pushed
the
traitify-style
branch
from
October 22, 2023 20:06
11e7840
to
71a76c2
Compare
nicoburns
force-pushed
the
traitify-style
branch
4 times, most recently
from
October 22, 2023 21:06
974929a
to
dd0c5dd
Compare
@nicoburns great stuff, even more flexible than what I thought of |
Patryk27
reviewed
Feb 8, 2024
/// The set of styles required for a Flexbox container | ||
pub trait FlexboxContainerStyle: CoreStyle { | ||
/// Which direction does the main axis flow in? | ||
#[inline(always)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, is it still worth doing considering rust-lang/rust#116505 exists? 👀
nicoburns
force-pushed
the
traitify-style
branch
from
April 16, 2024 22:40
dd0c5dd
to
d7ebe44
Compare
nicoburns
changed the title
WIP: "Traitify" the
"Traitify" the Apr 21, 2024
Style
structStyle
struct
nicoburns
force-pushed
the
traitify-style
branch
from
June 26, 2024 07:13
778a2b0
to
55a0d45
Compare
4 tasks
nicoburns
force-pushed
the
traitify-style
branch
4 times, most recently
from
July 3, 2024 05:22
21e44f2
to
d486843
Compare
nicoburns
force-pushed
the
traitify-style
branch
4 times, most recently
from
July 7, 2024 21:37
514bbd4
to
6441efc
Compare
nicoburns
force-pushed
the
traitify-style
branch
from
July 16, 2024 03:06
6441efc
to
824a3fd
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
code quality
Make the code cleaner or prettier.
enhancement
New feature or request
usability
Make the library more comfortable to use
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.
Objective
Allow users of Taffy to bring their own style representation(s).
Context
While we have support for custom node tree representations, we currently enforce usage of a concrete style representation. Additionally, that style representation is shared across all algorithms and thus must include the styles for Flexbox, CSS Grid and Block layout, making it quite large. A problem which will only get worse if non-css algorithms are supported in future.
Feedback wanted
Todo
Display
style. Algorithms typically only need to know whether theDisplay
isNone
or not. I am considering creating a new enum with justNone
andNormal
(name tbd) variants for this purpose. This would need to be extended withContents
if we implement that, but would never need to know about individual algorithms. See also:style::Display
is not according to specifications #115Remove theTurns out this is still required for root layoutget_style
method from the basePartialLayoutTree
trait