-
Notifications
You must be signed in to change notification settings - Fork 340
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 details in older browsers #3758
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/govuk-frontend/src/govuk/components/details/implementation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,49 @@ | ||
## Implementation notes | ||
|
||
### Styling in older browsers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😍 |
||
|
||
#### Browsers with support for `type=module`, `<details>` and feature queries | ||
|
||
https://browsersl.ist/#q=supports+details+and+supports+css-featurequeries+and+supports+es6-module®ion=GB | ||
|
||
Previously, we provided a polyfill for older browsers which do not support the | ||
`<details>` component. Since most browsers now DO support `<details>`, we've | ||
removed that polyfill, and we need to make sure browsers which don't support | ||
`<details>` don't use any styles that make them look interactable. | ||
|
||
By wrapping these styles in a feature query, we can capture the vast majority of | ||
browsers which have full support. | ||
|
||
#### Browsers that support `type=module` and feature queries but not `<details>` | ||
|
||
https://browsersl.ist/#q=supports+es6-module+and+not+supports+details+and+supports+css-featurequeries®ion=GB | ||
|
||
This only affects Edge 16 - 18. We filter these out of the support query by | ||
checking for `-ms-ime-align: auto`, which isn't supported by any other browsers. | ||
|
||
#### Browsers that support `<details>` but not `type=module` or feature queries | ||
|
||
https://browsersl.ist/#q=supports+details+and+not+supports+css-featurequeries+and+not+supports+es6-module®ion=GB | ||
|
||
These will default to their native styling of the `<details>` element, with a | ||
few of our spacing and font styles. | ||
|
||
#### Browsers which don't support `<details>`, `type=module` or feature queries | ||
|
||
https://browsersl.ist/#q=%3E0.0000001%25+and+not+supports+details+and+not+supports+es6-module+and+not+supports+css-featurequeries®ion=GB | ||
|
||
This is largely IE 8 - 11. | ||
|
||
We can account for IE by styling them like inset text, via a `@media screen\0` | ||
hack that no other browser supports. | ||
|
||
#### Browsers that support feature queries, but not `<details>` or `type=module` | ||
|
||
https://browsersl.ist/#q=supports+css-featurequeries+and+not+supports+details+and+not+supports+es6-module®ion=GB | ||
|
||
This is the only gap, as these browsers will get styled to look interactable, | ||
even though they aren't. This is largely Opera Mini. | ||
|
||
### Marker styling | ||
|
||
Firefox uses display: list-item to show the arrow marker for the summary | ||
|
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.
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.
This margin is being ignored in EdgeHTML Edge. It seems like you need to maintain the
display: inline-block
for this to be applied correctly.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.
Hmm, I can't reproduce this via Browserstack in Edge 15 - 18. What are you getting?

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.
The style appears in the inspector's style and computed tabs, but if you hover over the element so that the box model is highlighted on the page you can see that the
margin-bottom
value hasn't actually been used, even though it's not crossed out.The difference can also be seen if you do a side-by-side comparison with the existing review app—the border of the
<details>
contents has moved up by 5 pixels.I'm not sure why EdgeHTML devtools says the style is being used when it actually isn't, but I'm gonna chalk that up to EdgeHTML devtools maybe not being amazing. 😝
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.
Aah, nice spot! My basic trust in devtools is forever tainted.
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.
Done. Looking good so far.
