diff --git a/app/assets/stylesheets/header.css b/app/assets/stylesheets/header.css new file mode 100644 index 000000000..acbb3eb59 --- /dev/null +++ b/app/assets/stylesheets/header.css @@ -0,0 +1,44 @@ +@layer components { + /* Centered title with space for two buttons on either side */ + .header { + --header-gap: 0.5ch; + --btn-icon-size: 1rem; + --header-btn-size: 2rem; + --header-button-count: 0; + --header-actions-width: calc((var(--header-btn-size) + var(--header-gap)) * var(--header-button-count)); + + align-items: center; + display: flex; + padding: var(--block-space-half) var(--inline-space); + + /* Change the grid size depending on how many buttons are present */ + &:has(.header__actions > *:nth-child(1)) { --header-button-count: 1; } + &:has(.header__actions > *:nth-child(2)) { --header-button-count: 2; } + &:has(.header__actions > *:nth-child(3)) { --header-button-count: 3; } + } + + .header__actions { + display: flex; + font-size: var(--text-x-small); + gap: var(--header-gap); + inline-size: var(--header-actions-width); + min-inline-size: fit-content; + } + + .header__actions--start { + margin-inline-end: auto; + } + + .header__actions--end { + margin-inline-start: auto; + justify-content: flex-end; + } + + .header__title { + color: inherit; + font-size: var(--text-large); + font-weight: 900; + margin: 0 auto; + text-align: center; + } +} diff --git a/app/assets/stylesheets/utilities.css b/app/assets/stylesheets/utilities.css index 65ec98fcf..45cfd7d56 100644 --- a/app/assets/stylesheets/utilities.css +++ b/app/assets/stylesheets/utilities.css @@ -26,7 +26,7 @@ .txt-capitalize { text-transform: capitalize; } .txt-link { color: var(--color-link); text-decoration: underline; } - .font-black { font-weight: 900; } + .font-weight-black { font-weight: 900; } .font-weight-normal { font-weight: normal; } /* Flexbox and Grid */ diff --git a/app/views/accounts/settings/show.html.erb b/app/views/accounts/settings/show.html.erb index 7df94999c..9614946e0 100644 --- a/app/views/accounts/settings/show.html.erb +++ b/app/views/accounts/settings/show.html.erb @@ -1,17 +1,19 @@ <% @page_title = "Account Settings" %> <% content_for :header do %> -