Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Styling Documentation #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Styling Documentation #1

wants to merge 2 commits into from

Conversation

rosenjcb
Copy link

@rosenjcb rosenjcb commented Mar 11, 2021

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 a styling.md page with a primitive introduction. It's basically my understanding of how Iced came about and what it tries to do. Below are a few talking points I thought about putting into a section labeled Differences between CSS and Iced Styling (or something like that):

  • In CSS every element can have padding, but in iced only some basic widgets have access to this property. This includes Column, 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 the StyleSheet trait itself. Of course, there seems to be many StyleSheet traits, each one's definition unique to the widget 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 a StyleSheet 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant