Claro, Olivero and Umami hover/focus styles leak into the navigation

Created on 2 April 2024, 9 months ago
Updated 18 April 2024, 8 months ago

Problem/Motivation

After Reset theme css. Fixed , still some Umami styles leak into the navigation like the hover state in a submenu.

Steps to reproduce

1. Standard profile installation will give you Olivero and Claro themes
2. demo_umami profile installation will give you Umami theme
3. Don't forget to enable Top Bar /admin/config/user-interface/navigation/settings and test it
4. Go through the whole side navigation from logotype till "collapse sidebar" button
5. Go through the all levels of menu
6. Test hover, focus styles.

Proposed resolution

Fix the styles.

User interface changes

There shouldn't be visual changes on the default navigation.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain ckrina Barcelona

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ckrina
  • Assigned to kostyashupenko
  • 🇷🇺Russia kostyashupenko Omsk

    After investigation i found that not only Umami overrides styles of Navigation module, but also Claro and even Olivero sometimes. It's related to some global selectors which have bigger specificity than our global:

    :where(.admin-toolbar) *:focus {
        outline: var(--admin-toolbar-size-focus) solid var(--admin-toolbar-color-focus);
    }
    

    Here is screenshot illustrating that styles from Claro theme are overriding :focus on logotype in navigation bar.

    And now i think that having such selectors in user themes is a pretty popular thing:

    a:focus {
        ... something like setting outline globally for all links ...
    }
    

    And now we can't guarantee themes will never override navigation module styles. So we have to increase specificity of our selectors. To be sure we are safe in terms of styles no matter which theme is used.

    @finnsky suggested to go with this way https://developer.mozilla.org/en-US/docs/Web/CSS/@layer and i will try to implement it now

  • 🇷🇺Russia kostyashupenko Omsk

    UPD:

    Seems we can't go with @layer at-rules.

    @layer is useful only when need to override user agent styles seems like. But any CSS property written by us (author styles) has bigger specificity than @layer's. Always. Which means if we will wrap some code in @layer - user themes will still override navigation module styles.

    Will try to increase specificity of our selectors without @layer

  • 🇮🇳India ahsannazir

    Yes there are also other places where styles are getting overriden by umami. I agree with #2 and #3, we need to increase the specificity for selectors.
    e.g: .toolbar-menu__link:hover to a.toolbar-menu__link:hover

  • Pipeline finished with Success
    9 months ago
    Total: 248s
    #137284
  • Pipeline finished with Success
    9 months ago
    Total: 211s
    #137290
  • Issue was unassigned.
  • 🇷🇺Russia kostyashupenko Omsk

    Task is finished. Now Olivero, Claro and Umami are not overriding hover and focus styles of the navigation module

  • Status changed to Needs review 9 months ago
  • 🇪🇸Spain ckrina Barcelona
  • Pipeline finished with Skipped
    9 months ago
    #137706
  • Pipeline finished with Skipped
    9 months ago
    #137707
  • Status changed to Fixed 9 months ago
  • 🇪🇸Spain ckrina Barcelona

    Merged, thank you!

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Pipeline finished with Success
    7 months ago
    Total: 424s
    #171487
  • Pipeline finished with Success
    6 months ago
    Total: 82s
    #206574
  • Pipeline finished with Success
    6 months ago
    Total: 83s
    #206806
  • Pipeline finished with Success
    4 months ago
    Total: 322s
    #268687
  • Pipeline finished with Success
    4 months ago
    #269582
  • Pipeline finished with Success
    3 months ago
    Total: 457s
    #295557
  • Pipeline finished with Failed
    3 months ago
    Total: 424s
    #296675
  • Pipeline finished with Failed
    3 months ago
    Total: 1104s
    #301096
  • Pipeline finished with Failed
    3 months ago
    Total: 379s
    #301757
  • Pipeline finished with Failed
    3 months ago
    #302742
  • Pipeline finished with Success
    3 months ago
    #302785
  • Pipeline finished with Failed
    2 months ago
    Total: 449s
    #307152
  • Pipeline finished with Canceled
    2 months ago
    Total: 126s
    #307245
  • Pipeline finished with Failed
    2 months ago
    Total: 452s
    #307249
  • Pipeline finished with Failed
    2 months ago
    Total: 446s
    #307265
  • Pipeline finished with Failed
    2 months ago
    Total: 452s
    #307333
  • Pipeline finished with Success
    2 months ago
    Total: 417s
    #307345
  • Pipeline finished with Success
    2 months ago
    Total: 1788s
    #307401
  • Pipeline finished with Canceled
    2 months ago
    Total: 160s
    #309547
  • Pipeline finished with Success
    2 months ago
    Total: 426s
    #309548
  • Pipeline finished with Failed
    about 2 months ago
    Total: 538s
    #325073
  • Pipeline finished with Skipped
    23 days ago
    #354326
  • Pipeline finished with Success
    23 days ago
    Total: 150s
    #354583
  • Pipeline finished with Canceled
    23 days ago
    Total: 127s
    #354589
  • Pipeline finished with Canceled
    23 days ago
    Total: 31s
    #354595
  • Pipeline finished with Success
    23 days ago
    Total: 208s
    #354596
Production build 0.71.5 2024