This repository has been archived by the owner on Sep 14, 2021. It is now read-only.
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.
Please don't immediately accept this merge request, I want this to be an open discussion. As promised here, I wanted to write a bit of documentation on the styling story that exists in
Iced
right now. I wrote astyling.md
page with a primitive introduction. It's basically my understanding of howIced
came about and what it tries to do. Below are a few talking points I thought about putting into a section labeledDifferences between CSS and Iced Styling
(or something like that):In
CSS
every element can have padding, but iniced
only some basicwidgets
have access to this property. This includesColumn
,Row
,Container
, et cetera.Right now some of the styling is kept in a
StyleSheet
, but not all styling rules.padding
right now is set by a function call but I don't see anyway to define padding in theStyleSheet
trait itself. Of course, there seems to be manyStyleSheet
traits, each one's definition unique to thewidget
itself.Maybe we can talk about default values. Right now, there's an open issue about the fact that
StyleSheet
trait objects don't have default implementations, but this might be fixed with a PR soon. I think default values are obviously useful and emphasizing that you can overide these default values, either in a custom widget or by passing aStyleSheet
object to a widget you're already using, is important.Please correct any mistakes or false statements I have made. I'm still learning the project as well. Also, feel free to add in stuff you'd like to see in the Styling doc.