Skip to content

No-text repo tabs on mobile #5805

Closed

Description

@fregante

We discussed this before but there was never a specific issue, I think.

Can we hide the labels on mobile?

Screen Shot 2

@media (max-width:767px) {
	.UnderlineNav-item [data-content] {
		overflow: hidden;
		display: inline-block;
		width: 0; /* Preserve the button height; display: none collapses it*/
	}
	.UnderlineNav-item svg {
		margin-right: 0 !important;
	}
}

If the tabs aren't differentiable enough, we can keep the hover state on:

Screen Shot 3

But there's probably a better style for that.

.UnderlineNav-item {
	background: var(--color-action-list-item-default-hover-bg);
}

Activity

  1. fregante commented on Jul 8, 2022

    @fregante
    Author
  2. fregante commented on Jul 8, 2022

    @fregante
    MemberAuthor

    before

  3. added
    small
    on Apr 26, 2023
  4. fregante commented on Apr 27, 2023

    @fregante
    MemberAuthor

    Updated CSS

    @media (max-width:767px) {
    	.UnderlineNav-item:not(.selected):not(:hover, :focus) {
    		background: var(--color-canvas-default);
    	}
    	.UnderlineNav-item:not(.selected) [data-content] {
    		overflow: hidden;
    		display: inline-block;
    		width: 0; /* Preserve the button height; display: none collapses it*/
    	}
    	.UnderlineNav-item:not(.selected) svg {
    		margin-right: 0 !important;
    	}
    	.UnderlineNav-item:not(.selected) .Counter {
    		background: none;
    	}
    }

    Demo (8 tabs visible)

    Screenshot

    Native (4 tabs visible)

    Screenshot 1

  5. fregante commented on May 12, 2023

    @fregante
    MemberAuthor
    Screenshot

    I've been using the CSS above for 2 weeks and I think it looks great. Perhaps there's one more improvement: keep the text, but smaller and below the button.

    This helps avoid confusion with icons like the wiki’s:

    Screenshot 1

    (I hacked this together in the dev tools, no CSS exported)

  6. removed
    small
    on May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions