Skip to content

Commit

Permalink
Merge pull request #3438 from projectblacklight/logo
Browse files Browse the repository at this point in the history
Allow managing all settings from blacklight_defaults.scss via CSS variables
  • Loading branch information
jcoyne authored Nov 21, 2024
2 parents ef61f0b + a6b689b commit 2c0fe7c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
6 changes: 3 additions & 3 deletions app/assets/stylesheets/blacklight/_facets.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.sidenav {
--bl-facet-active-bg: #{$facet-active-bg};
--bl-facet-active-item-color: #{$facet-active-item-color};
--bl-facet-active-bg: var(--bs-success);
--bl-facet-active-item-color: var(--bs-success);
--bl-facet-remove-color: var(--bs-secondary-color);

.facet-toggle-button {
Expand Down Expand Up @@ -66,7 +66,7 @@
.facet-limit-active {
--bs-accordion-btn-bg: var(--bl-facet-active-bg);
--bs-btn-hover-bg: var(--bs-accordion-btn-bg);
--bs-accordion-btn-color: #{color-contrast($facet-active-bg)};
--bs-accordion-btn-color: var(--bs-light);
--bs-btn-hover-color: var(--bs-accordion-btn-color);
--bs-accordion-active-color: var(--bs-accordion-btn-color);
}
Expand Down
10 changes: 4 additions & 6 deletions app/assets/stylesheets/blacklight/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

.navbar-logo {
/* The main logo image for the Blacklight instance */
@if $logo-image {
background: transparent $logo-image no-repeat top left;
background-size: $logo-width $logo-height;
}
height: $logo-height;
background: transparent var(--bl-logo-image) no-repeat top left;
background-size: var(--bl-logo-width) var(--bl-logo-height);
height: var(--bl-logo-height);
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
width: $logo-width;
width: var(--bl-logo-width);
}

.navbar-search {
Expand Down
22 changes: 9 additions & 13 deletions app/assets/stylesheets/blacklight/blacklight_defaults.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
/* Warning! If you want to change these, just copy them into your own theme css. But you want to remove the !default, which only will set them if not already set. */

$logo-image: url("blacklight/logo.png") !default;
$logo-width: 150px !default;
$logo-height: 50px !default;

$facet-active-bg: $success !default;
$facet-active-item-color: $success !default;

/* for compatability with BS < 5.3 */
$body-secondary-color: rgba($body-color, 0.75) !default;

:root {
--bs-secondary-color: #{$body-secondary-color}; /* for compatability with BS < 5.3 */
--bl-logo-image: url("blacklight/logo.png");
--bl-logo-width: 150px;
--bl-logo-height: 50px;
--bs-secondary-color: rgba(
33,
37,
41,
0.75
); /* for compatability with BS < 5.3 */

--bl-main-padding-y: 0.5rem;

Expand Down

0 comments on commit 2c0fe7c

Please sign in to comment.