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

style::Display is not according to specifications #115

Closed
Weibye opened this issue Jun 9, 2022 · 2 comments
Closed

style::Display is not according to specifications #115

Weibye opened this issue Jun 9, 2022 · 2 comments
Labels
breaking-change A change that breaks our public interface bug Something isn't working code quality Make the code cleaner or prettier.

Comments

@Weibye
Copy link
Collaborator

Weibye commented Jun 9, 2022

Our current Display-style looks like this

struct Display {
    Flex,
    None
}

This definition does not actually exist in the specification. As far as I can tell, these are two separate properties:

I think it makes more sense to define the two different properties according to specifications as two separate enums, to be controlled or improved upon independently

Originally posted by @Weibye in #96 (comment)

@Weibye Weibye changed the title style::Display Is not according to specifications style::Display is not according to specifications Jun 9, 2022
@Weibye Weibye added bug Something isn't working code quality Make the code cleaner or prettier. breaking-change A change that breaks our public interface and removed bug Something isn't working labels Jun 9, 2022
@alice-i-cecile alice-i-cecile added the bug Something isn't working label Jun 9, 2022
@alice-i-cecile
Copy link
Collaborator

Related to #28.

@alice-i-cecile alice-i-cecile added the good first issue Good for newcomers label Jun 12, 2022
@nicoburns nicoburns mentioned this issue Jul 22, 2022
87 tasks
@nicoburns nicoburns removed the good first issue Good for newcomers label Dec 30, 2022
@nicoburns
Copy link
Collaborator

This property does exist in the specification (https://www.w3.org/TR/css-display-3/#the-display-properties). The specification defines it as:

<display> = [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>

<display-outside>  = block | inline | run-in
<display-inside>   = flow | flow-root | table | flex | grid | ruby
<display-listitem> = <display-outside>? && [ flow | flow-root ]? && list-item
<display-internal> = table-row-group | table-header-group |
                     table-footer-group | table-row | table-cell |
                     table-column-group | table-column | table-caption |
                     ruby-base | ruby-text | ruby-base-container |
                     ruby-text-container
<display-box>      = contents | none
<display-legacy>   = inline-block | inline-table | inline-flex | inline-grid

Where:

  • | means "or"
  • && means "and"
  • ? means optional
  • || means "concatenate"

This specification does include some cases where you need to specify more than one keyword however those cases are only hit in the case of display: list-item, or when specifying both a <display-inside> and <display-outside> value. But as we don't support display: list-item and only block as the display-outside value we do not need to support these cases, and can simplify this specification down to a flat enum.

@nicoburns nicoburns closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that breaks our public interface bug Something isn't working code quality Make the code cleaner or prettier.
Projects
None yet
Development

No branches or pull requests

3 participants