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

Document CSS Styles #629

Merged
merged 32 commits into from
Aug 5, 2022
Merged

Document CSS Styles #629

merged 32 commits into from
Aug 5, 2022

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Jul 30, 2022

  • Adds docs for most of the Styles. There are a few styles remaining which are not quite final
  • Adds a textual CLI command to view borders
Screen.Recording.2022-08-04.at.15.46.51.mov
Screen.Recording.2022-08-04.at.15.47.42.mov

@willmcgugan willmcgugan marked this pull request as draft July 30, 2022 12:04
@willmcgugan willmcgugan changed the title Docs WIP Document CSS Styles Aug 4, 2022
@willmcgugan willmcgugan marked this pull request as ready for review August 4, 2022 14:59
@willmcgugan willmcgugan requested a review from darrenburns August 4, 2022 15:01
Copy link
Member

@darrenburns darrenburns left a 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.

class BackgroundApp(App):
CSS = """
Static {
height:1fr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
height:1fr;
height: 1fr;

docs/examples/styles/background.py Outdated Show resolved Hide resolved
docs/examples/styles/border.py Outdated Show resolved Hide resolved
docs/examples/styles/box_sizing.py Outdated Show resolved Hide resolved
docs/examples/styles/color.py Outdated Show resolved Hide resolved
docs/styles/color.md Outdated Show resolved Hide resolved
@@ -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.
Copy link
Member

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.

Copy link
Collaborator Author

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.

Comment on lines +27 to +28
/* Automatic height */
width: auto
Copy link
Member

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 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah. Will add.

Copy link
Collaborator Author

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.

docs/styles/visibility.md Outdated Show resolved Hide resolved
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad.

@willmcgugan willmcgugan merged commit 589bf6a into css Aug 5, 2022
@willmcgugan willmcgugan deleted the docs branch August 5, 2022 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants