Skip to content

Make <ha-card> use <h1> for header#7373

Merged
bramkragten merged 2 commits intohome-assistant:devfrom
spacegaier:ha-card-header
Oct 17, 2020
Merged

Make <ha-card> use <h1> for header#7373
bramkragten merged 2 commits intohome-assistant:devfrom
spacegaier:ha-card-header

Conversation

@spacegaier
Copy link
Member

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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Co-authored-by: Zack Barett <zackbarett@hey.com>
@bramkragten bramkragten merged commit 7e769d0 into home-assistant:dev Oct 17, 2020
@spacegaier spacegaier deleted the ha-card-header branch October 17, 2020 21:30
@bramkragten bramkragten mentioned this pull request Oct 21, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants