Make <ha-card> use <h1> for header#7373
Merged
bramkragten merged 2 commits intohome-assistant:devfrom Oct 17, 2020
Merged
Conversation
9 tasks
zsarnett
reviewed
Oct 17, 2020
zsarnett
reviewed
Oct 17, 2020
zsarnett
approved these changes
Oct 17, 2020
Co-authored-by: Zack Barett <zackbarett@hey.com>
Merged
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Breaking change
Proposed change
As confirmed by bram (#7323 (comment)) we should use more
<h>elements (allows e.g. proper/better copying of data into documents such as MS Word). I converted the<ha-card>to do so. This enables proper copying of the system health info (see separate PR #7337 that depends on this one here).The switch to
<h1>for the header has no visual impact. I also replaced all occurrences where the "header" attribute of>ha-card>is not used an instead a custom HTML element was used. Those are now all<h1>as well.The CSS change I made is to ensure that header that contain an icon have the same height as ones without. This is e.g. required for the device config page, where otherwise the headers would be misaligned between those different cards since some have a "plus" icon, some don't. This previously resulted in the ones with icon being 48px high, but those without only 32px. Now they are all 48px, and I removed some padding on top to counter balance that, so overall they remain the same size.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: