Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 100% width on Service Navigation by default #5425

Open
joelanman opened this issue Oct 22, 2024 · 0 comments
Open

Use 100% width on Service Navigation by default #5425

joelanman opened this issue Oct 22, 2024 · 0 comments
Labels
feature request User requests a new feature service navigation

Comments

@joelanman
Copy link
Contributor

Related component

Service Navigation

Context

Trying to add right aligned links (Sign in/Sign out and so on).

I think it might be better for the Service Navigation to have 100% width by default, to make it easier to add quite a common pattern - right aligned elements.

I can add css to align them right, but only if the navigation wrapper has 100% width. So my code looks like this (note the wrapper css):

{{ govukHeader({ serviceName: serviceName, classes:"govuk-header--full-width-border"}) }}

<style>
    .govuk-service-navigation__wrapper{
        flex-grow: 1;
    }
</style>

{% set navigationEnd %}
  <li class="govuk-service-navigation__item" style="margin-left: auto;">
    <a class="govuk-service-navigation__link" href="#">Sign out</a>
  </li>
{% endset %}

{{ govukServiceNavigation({

    navigation: [
      {
        href: "#",
        text: "Section A"
      },
      {
        href: "#",
        text: "Section B"
      }
    ],
    slots: {
        navigationEnd: navigationEnd
    }
  }) }}

Alternatives

I'm applying 100% width as an override

Additional information (if applicable)

@joelanman joelanman added awaiting triage Needs triaging by team feature request User requests a new feature labels Oct 22, 2024
@romaricpascal romaricpascal added service navigation and removed awaiting triage Needs triaging by team labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request User requests a new feature service navigation
Projects
None yet
Development

No branches or pull requests

2 participants