Skip to content

Commit

Permalink
Merge pull request #119 from opf/feature/55190-extend-primer-componen…
Browse files Browse the repository at this point in the history
…t-pageheader-to-support-tabs

[#55190] Fix Tab Nav vertical spacing in Page Header
  • Loading branch information
HDinger authored Jun 5, 2024
2 parents 867b9ec + f00a78e commit 1d6093d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-lions-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Fix Tab Nav vertical spacing in Page Header
12 changes: 6 additions & 6 deletions app/components/primer/open_project/page_header.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
flex-flow: column;
}

.PageHeader--noBorder {
.PageHeader--withTabNav {
border-bottom: none;
padding-bottom: 0;
margin-bottom: 0;
}

.PageHeader-contextBar {
Expand Down Expand Up @@ -46,6 +47,10 @@
flex: 1 100%;
}

.PageHeader--withTabNav .PageHeader-description {
margin-bottom: var(--space-xlarge);
}

.PageHeader-actions {
justify-content: flex-end;
display: flex;
Expand All @@ -65,8 +70,3 @@
.PageHeader-parentLink {
flex: 1 1 auto;
}

.PageHeader-tabNav {
margin-top: var(--stack-gap-normal);
margin-bottom: 0;
}
2 changes: 1 addition & 1 deletion app/components/primer/open_project/page_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class PageHeader < Primer::Component
#
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
renders_one :tab_nav, lambda { |**system_arguments, &block|
@system_arguments[:classes] = class_names(@system_arguments[:classes], "PageHeader--noBorder")
@system_arguments[:classes] = class_names(@system_arguments[:classes], "PageHeader--withTabNav")

system_arguments = deny_tag_argument(**system_arguments)
system_arguments[:tag] = :div
Expand Down
5 changes: 1 addition & 4 deletions static/classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
"PageHeader": [
"Primer::OpenProject::PageHeader"
],
"PageHeader--noBorder": [
"PageHeader--withTabNav": [
"Primer::OpenProject::PageHeader"
],
"PageHeader-actions": [
Expand All @@ -450,9 +450,6 @@
"PageHeader-parentLink": [
"Primer::OpenProject::PageHeader"
],
"PageHeader-tabNav": [
"Primer::OpenProject::PageHeader"
],
"PageHeader-title": [
"Primer::OpenProject::PageHeader"
],
Expand Down
2 changes: 1 addition & 1 deletion test/components/primer/open_project/page_header_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_renders_tab_nav
end
end

assert_selector(".PageHeader--noBorder")
assert_selector(".PageHeader.PageHeader--withTabNav")
assert_selector(".PageHeader-tabNav")
assert_selector(".PageHeader-tabNav .tabnav-tab")
end
Expand Down

0 comments on commit 1d6093d

Please sign in to comment.