-
Notifications
You must be signed in to change notification settings - Fork 826
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
Document CSS Styles #629
Document CSS Styles #629
Conversation
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.
A bunch of suggestions, take or leave any of them. Docs are something we can iterate on easily anyway.
docs/examples/styles/background.py
Outdated
class BackgroundApp(App): | ||
CSS = """ | ||
Static { | ||
height:1fr; |
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.
height:1fr; | |
height: 1fr; |
@@ -0,0 +1,48 @@ | |||
# Display | |||
|
|||
The `display` property defines if a Widget is displayed or not. The default value is `"block"` which will display the widget as normal. Setting the property to `"none"` will effectively make it invisible. |
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.
Doesn't it also affect the layout of other widgets? The Widget isn't invisible - it's no longer there at all. Might be worth expanding on that now or in the future in order to differentiate this from visiblility: hidden
.
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.
It won't affect the layout if display is none. Will revisit this when there are docs that describe layout.
/* Automatic height */ | ||
width: auto |
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.
Without saying what auto
means this isn't very valuable. In fact, I've totally forgotten what it means and would love if these docs told me 😄
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.
Ah yeah. Will add.
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.
Actually, there is rather a lot to explain regarding dimensions, not just auto. I'll come back to this one.
@@ -30,7 +30,7 @@ def arrange( | |||
total_fraction = sum( | |||
[int(style.width.value) for style in styles if style.width.is_fraction] | |||
) | |||
fraction_unit = Fraction(size.height, total_fraction or 1) | |||
fraction_unit = Fraction(size.width, total_fraction or 1) |
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.
:)
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.
My bad.
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Co-authored-by: darrenburns <[email protected]>
Screen.Recording.2022-08-04.at.15.46.51.mov
Screen.Recording.2022-08-04.at.15.47.42.mov