Skip to content

Add align-repository-header feature - #3313

Merged
fregante merged 9 commits into
masterfrom
align-repository-header
Jul 6, 2020
Merged

fregante merged 9 commits into
masterfrom
align-repository-header

Conversation

@fregante

@fregante fregante commented Jul 3, 2020

Copy link
Copy Markdown
Member

Fixes #3280
Replaces and closes #3250

Instead of aligning both sides and limiting the available space for the tabs, this only aligns the left side

Comment thread package.json
"selector-class-pattern": null,
"selector-id-pattern": null
"selector-id-pattern": null,
"selector-max-universal": null

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@sindresorhus this rule seems rather arbitrary

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

* is very inefficient and far-reaching. I think it makes sense to limit it in normal code. RG is an expectation since it has to do a lot of overrides, that you wouldn't do in a normal codebase.

@@ -0,0 +1,21 @@
/* Align repo header to the content, just on the left side */
.repohead > * {
padding-left: calc(50% - 1280px / 2) !important;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is overridden by GitHub:

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

How’s that possible? The selector is less specific than ours

@FloEdelmann FloEdelmann Jul 4, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@fregante * has a specificity of zero (see Specifishity), so they are equally specific and the latter overrides the former.

@fregante fregante Jul 4, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That’s weird. I’ve always thought that > increased specificity.

I guess I can replace a star with a tag name and solve both reviews in this PR

@fregante fregante Jul 5, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can't, there are 2 tag types in each level (div/nav > div/ul) and :is() isn't supported by Chrome yet. I used !important

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's still overridden. Can we use .repohead > div, .repohead > nav?

@fregante

fregante commented Jul 6, 2020

Copy link
Copy Markdown
Member Author

@fregante
fregante merged commit a90ae3c into master Jul 6, 2020
@fregante
fregante deleted the align-repository-header branch July 6, 2020 08:50
@yakov116

yakov116 commented Jul 8, 2020

Copy link
Copy Markdown
Member

Looks like this has an adverse effect on gists
Before
image
After
image

@kidonng

kidonng commented Jul 8, 2020

Copy link
Copy Markdown
Member

.repohead -> .repohead:not(.gisthead)

@epmatsw

epmatsw commented Jul 9, 2020

Copy link
Copy Markdown

Looks like this breaks enterprise users: #3330

@fregante

fregante commented Jul 10, 2020 •

Copy link
Copy Markdown
Member Author

PR welcome to fix gists and #3332

Gists should be identifiable with body.gist

@szmarczak

Copy link
Copy Markdown

How can I use this? I'm having 20.7.16 and I still see no difference...

@kidonng

kidonng commented Jul 18, 2020

Copy link
Copy Markdown
Member

@szmarczak Because it's broken now #3362 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Properly align tab navigation

7 participants