Skip to content

Commit

Permalink
Style inverted secondary menu using css variables:
Browse files Browse the repository at this point in the history
- use inverted colors to set colors in volto-tabs-block which received
  some css to look ok also when we have secondary and inverted options
- inverted non active color is now the white with a bit of opacity as
  requested by Marie with full white on active or hover
- in accordion primary and tertiary also add secondary since that could
  be the option from the tab or accordion option instead of our theme
  in which case primary was overriden by secondary
- Removed the older compatibility typos from site.variables
  • Loading branch information
ichim-david committed Oct 24, 2023
1 parent 47c2050 commit d3a8d7c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
5 changes: 4 additions & 1 deletion theme/themes/eea/collections/menu.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@
box-shadow: none;
}


.ui.secondary.vertical.menu > .item,
.ui.vertical.menu .item {
padding: @verticalItemPadding;
Expand Down Expand Up @@ -444,6 +443,10 @@
}

.ui.secondary.inverted.menu {
--inverted-text-color: @invertedItemTextColor;
--inverted-hover-text-color: @white;
--inverted-bg-color: var(--bg-color, @secondaryColorCSSVar);
--inverted-secondary-border-color: @secondaryPointingInvertedBorderColor;
background-color: var(--bg-color, @secondaryColorCSSVar);
}

Expand Down
2 changes: 1 addition & 1 deletion theme/themes/eea/collections/menu.variables
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
@secondaryPointingItemMaxWidth: 15.625rem;

/* Inverted Secondary */
@secondaryInvertedColor: @white;
@secondaryInvertedColor: @invertedTextColor;

@secondaryInvertedHoverBackground: @strongTransparentBlack;
@secondaryInvertedHoverColor: @invertedSelectedTextColor;
Expand Down
5 changes: 1 addition & 4 deletions theme/themes/eea/globals/site.variables
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@
/*-------------------
Pastanaga Toolbar
--------------------*/
// legacy variable names kept for tests and older volto versions use the toolbar variables from now on
@toolbalWidth: 80px;
@toolbalWidthMin: 20px;

@toolbarWidth: 80px;
@toolbarWidthMin: 20px;
Expand Down Expand Up @@ -618,7 +615,7 @@
@selectedTextColor : rgba(0, 0, 0, 0.95);
@disabledTextColor : rgba(0, 0, 0, 0.2);

@invertedTextColor : @white;
@invertedTextColor : rgba(255, 255, 255, 0.9);
@invertedMutedTextColor : rgba(255, 255, 255, 0.8);
@invertedLightTextColor : rgba(255, 255, 255, 0.7);
@invertedUnselectedTextColor : rgba(255, 255, 255, 0.5);
Expand Down
21 changes: 15 additions & 6 deletions theme/themes/eea/modules/accordion.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
&.filter-listing {
.title {
.icon {
margin-left: @filterListingIconMarginLeft !important;
font-size: @filterListingIconFontSize;
line-height: @filterListingIconLineHeight;
margin-left: @filterListingIconMarginLeft !important;
}
}
}
Expand Down Expand Up @@ -155,12 +155,16 @@
/* Primary */
.ui.accordion.primary > .active.title,
.ui.accordion.primary.inverted > .title,
.ui.accordion.primary > .filter {
.ui.accordion.primary > .filter,
.ui.accordion.secondary.primary > .active.title,
.ui.accordion.secondary.primary.inverted > .title,
.ui.accordion.secondary.primary > .filter {
--bg-color: @primaryColorCSSVar;
}

.ui.accordion.primary:not(.inverted) > .title:not(.active, .filter):hover,
.ui.accordion.primary:not(.inverted) > .title:not(.active, .filter):focus-visible {
.ui.accordion.primary:not(.inverted)
> .title:not(.active, .filter):focus-visible {
--text-color-hover: @primaryColorCSSVar;
}

Expand All @@ -172,19 +176,24 @@
}

.ui.accordion.secondary:not(.inverted) > .title:not(.active, .filter):hover,
.ui.accordion.secondary:not(.inverted) > .title:not(.active, .filter):focus-visible {
.ui.accordion.secondary:not(.inverted)
> .title:not(.active, .filter):focus-visible {
--text-color-hover: @secondaryColorCSSVar;
}

/* Tertiary */
.ui.accordion.tertiary > .active.title,
.ui.accordion.tertiary.inverted > .title,
.ui.accordion.tertiary > .filter {
.ui.accordion.tertiary > .filter,
.ui.accordion.secondary.tertiary > .active.title,
.ui.accordion.secondary.tertiary.inverted > .title,
.ui.accordion.secondary.tertiary > .filter {
--bg-color: @tertiaryColorCSSVar;
}

.ui.accordion.tertiary:not(.inverted) > .title:not(.active, .filter):hover,
.ui.accordion.tertiary:not(.inverted) > .title:not(.active, .filter):focus-visible {
.ui.accordion.tertiary:not(.inverted)
> .title:not(.active, .filter):focus-visible {
--text-color-hover: @tertiaryColorCSSVar;
}

Expand Down

0 comments on commit d3a8d7c

Please sign in to comment.