Skip to content

refactor: respect HTML Semantic Elements and clean style#1024

Merged
frenck merged 2 commits intohome-assistant:devfrom
hacf-fr:refactor/html_semantic_and_clean_style
Feb 5, 2026
Merged

refactor: respect HTML Semantic Elements and clean style#1024
frenck merged 2 commits intohome-assistant:devfrom
hacf-fr:refactor/html_semantic_and_clean_style

Conversation

@Quentame
Copy link
Member

@Quentame Quentame commented Oct 27, 2025

Respect HTML Semantic Elements: https://www.w3schools.com/html/html5_semantic_elements.asp

Before

  • body
    • div.container
      • div.nav-bar
        • a & h1
        • ul
    • div.container.content
      • (page content)
    • div.container
      • div.footer
    • ... (script, style ...)

After

  • body
    • div.container
      • header.nav-bar
        • a & h1
        • nav
          • ul
      • main
        • (page content)
      • footer.footer
    • ... (script, style ...)

Also permits to manage only one .container for all pages.
.container design inspired from the Bootstrap framework : https://getbootstrap.com/docs/5.3/layout/containers/

Clean unused / doubled CSS rules

Also contains some formating of base.html as #1025 did for other HTML files

@Quentame Quentame force-pushed the refactor/html_semantic_and_clean_style branch from fe0c49f to 26981e6 Compare October 27, 2025 13:01
@Quentame Quentame mentioned this pull request Oct 27, 2025
ludeeus pushed a commit that referenced this pull request Nov 11, 2025
- `site/src/_layouts/base.html` formating is done with #1024
- `site/src/index.html` formating is done with #1022
@Quentame Quentame force-pushed the refactor/html_semantic_and_clean_style branch from 26981e6 to 87c862d Compare November 25, 2025 08:42
@Quentame Quentame force-pushed the refactor/html_semantic_and_clean_style branch from 87c862d to c4bb1f8 Compare February 3, 2026 13:10
@djwmarcx djwmarcx self-requested a review February 3, 2026 14:16
@frenck frenck requested a review from Copilot February 5, 2026 09:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the HTML structure to use semantic HTML5 elements (header, nav, main, footer) instead of generic divs, consolidates the container structure to a single wrapper, and removes unused CSS rules. The changes improve code maintainability and follow HTML5 best practices.

Changes:

  • Replaced generic div elements with semantic HTML5 elements (header, nav, main, footer) in the base layout
  • Consolidated three separate container divs into a single container wrapping all content
  • Removed unused CSS rules (.logo, .initiative, nav-bar img styles) and duplicate properties
  • Improved template variable formatting for consistency (spacing around {{ and }})

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
site/src/_layouts/base.html Refactored to use semantic HTML elements and improved template formatting; consolidated container structure
site/src/_static/styles.css Removed unused CSS classes and duplicate properties; improved responsive design organization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @Quentame 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck frenck merged commit bc538b1 into home-assistant:dev Feb 5, 2026
13 checks passed
@Quentame Quentame deleted the refactor/html_semantic_and_clean_style branch February 5, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants