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

Support setting masthead height in a theme #19581

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions client/src/components/Masthead/Masthead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ onMounted(() => {
padding: 0;
margin-bottom: 0;
background: var(--masthead-color);
height: $masthead-height;
height: var(--masthead-height);
&:deep(.navbar-nav) {
height: $masthead-height;
height: var(--masthead-height);
& > li {
// This allows the background color to fill the full height of the
// masthead, while still keeping the contents centered (using flex)
Expand Down Expand Up @@ -203,20 +203,21 @@ onMounted(() => {
}
.navbar-brand {
cursor: pointer;
line-height: $masthead-height;
line-height: var(--masthead-height);
img {
filter: $text-shadow;
display: inline;
border: none;
height: 2rem;
height: var(--masthead-logo-height);
padding: inherit;
}
}
.navbar-text {
filter: $text-shadow;
font-weight: bold;
font-family: Verdana, sans-serif;
font-size: 1rem;
line-height: $masthead-height;
line-height: var(--masthead-height);
color: var(--masthead-text-color);
}
}
Expand Down
2 changes: 2 additions & 0 deletions client/src/style/scss/custom_theme_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

html,
.reset-theme-variables {
--masthead-height: #{$masthead-height};
--masthead-logo-height: calc(var(--masthead-height) * 0.6);
--masthead-color: #{$masthead-color};
--masthead-text-color: #{$masthead-text-color};
--masthead-text-hover: #{$masthead-text-hover};
Expand Down
1 change: 1 addition & 0 deletions client/src/style/scss/theme/blue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ $body-bg: $white;

// Masthead
$masthead-height: 2.5rem;
$masthead-logo-height: $masthead-height * 0.6;

// Side panels
$panel-bg-color: $brand-light;
Expand Down
17 changes: 17 additions & 0 deletions lib/galaxy/config/sample/themes_conf.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,20 @@ smoky:
active: "#FF206E"
logo:
img: "/static/favicon.svg"

anvil:
masthead:
color: "#012840"
height: "3rem"
text:
color: "#f6f7f4"
hover: "#e0dd10"
active: "#ffff"
link:
color: transparent
hover: transparent
active: "#00090e"
logo:
height: "1.8rem"
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for working on this. Overall this looks fine to me, but I would prefer masthead-logo-height to not be a theme variable, but rather derived as ratio of the masthead head height as you suggest above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now the height is optional and is only included in the sample theme until I can figure out how to get it to be recalculated. I was hoping @ElectronicBlueberry's suggestion would fix that, but I'm still seeing the value for --masthead-logo-height to be 2.5 * 0.6 and not 3.0 * 0.6 as it should be if it was using the masthead height as defined in the theme. Laila, do you have any suggestions?

img: "/static/images/galaxy_project_logo_white_square.png"
img-secondary: "/static/images/anvilwhite.png"
Loading