Skip to content

Add optional divider (bottom-border)#1

Merged
andrzejnovak merged 2 commits intocms-cat:mainfrom
IzaakWN:addDivider
Mar 30, 2026
Merged

Add optional divider (bottom-border)#1
andrzejnovak merged 2 commits intocms-cat:mainfrom
IzaakWN:addDivider

Conversation

@IzaakWN
Copy link
Copy Markdown
Contributor

@IzaakWN IzaakWN commented Mar 26, 2026

Thank you for the nice plugin! I'll try to integrate it into the TauPOG website soon!

This PR adds the option to add a divider below a given menu item, e.g.:

dropdowns:
  - title: "CMS Docs"
    #icon: "/assets/CMSlogo_white_nolabel_1024_May2014.png"
    icon: "/assets/CMSlogo_black_nolabel_1024_May2014.png"
    links:
      - text: "CAT Analysis Docs"
        url: "https://cms-analysis.docs.cern.ch/"
        target: "_blank"
        border-bottom: true
      - text: "Corrections (JSONs)"
        url: "https://cms-analysis-corrections.docs.cern.ch"
      - text: "JetMET Corrections"
        url: "https://cms-jerc.web.cern.ch"
        border-bottom: 5
      - text: "JetMET TWiki"
        url: "https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetMET#Quick_links_to_current_recommend"
      - text: "E/Gamma TWiki"
        url: "https://twiki.cern.ch/twiki/bin/viewauth/CMS/EgammaPOG"
        target: "_blank"
      - text: "MUO Wiki"
        url: "https://muon-wiki.docs.cern.ch/guidelines/"
        target: "_blank"
      - text: "BTV Wiki"
        url: "https://btv-wiki.docs.cern.ch/"
    ...

The current implementation allows bottom-border to be set as

  • True via yes, on, true (case-insensitive), setting the border width to 1px;
  • a number (integer or float), setting the border width in units of px.

It adds and extra_style, which in the future could also be used for other customizations of the style/appearance of menu items. Maybe it makes more sense to add a divider as a separate item in the links list, but the implementation would be more painful, and I think it's user-friendly enough.

Tested locally for the TauPOG website.

example

@andrzejnovak andrzejnovak merged commit 9cf0963 into cms-cat:main Mar 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants