Skip to content
Snippets Groups Projects
Commit c692d2ff authored by Claas Kazzer's avatar Claas Kazzer :speech_balloon: Committed by Robert Lange
Browse files

refs #22646 [finc] Corrects reset filters focus tabbing

* removes styles from containing element
* sets styles for anchor contained within
* Reset filters: unsets focus on outer elements, clarifies dropdown
* active filters revision
* streamlines scss
parent d27b4d26
No related merge requests found
...@@ -853,7 +853,7 @@ $search-filters-margin-bottom: 4px !default; ...@@ -853,7 +853,7 @@ $search-filters-margin-bottom: 4px !default;
$search-filters-padding: .5rem 5px !default; $search-filters-padding: .5rem 5px !default;
$search-filter-remove-button-vertical-align: top !default; $search-filter-remove-button-vertical-align: middle !default;
$search-filter-remove-button-text-display: inline-block !default; $search-filter-remove-button-text-display: inline-block !default;
$search-filter-remove-button-text-max-width: 200px !default; $search-filter-remove-button-text-max-width: 200px !default;
$search-filter-remove-button-text-overflow: hidden !default; $search-filter-remove-button-text-overflow: hidden !default;
...@@ -861,7 +861,9 @@ $search-filter-remove-button-text-text-overflow: ellipsis !default; ...@@ -861,7 +861,9 @@ $search-filter-remove-button-text-text-overflow: ellipsis !default;
$search-filter-remove-button-text-white-space: nowrap !default; $search-filter-remove-button-text-white-space: nowrap !default;
$search-filter-remove-icon: '\f00d' !default; $search-filter-remove-icon: '\f00d' !default;
$search-filter-remove-icon-display: inline-block !default;
$search-filter-remove-icon-hover-color: $red !default; $search-filter-remove-icon-hover-color: $red !default;
$search-filter-remove-icon-top-margin: -2px !default;
$search-filter-remove-icon-vertical-align: top !default; $search-filter-remove-icon-vertical-align: top !default;
$search-filter-remove-icon-in-dropdown-distance-from-right: 1rem !default; $search-filter-remove-icon-in-dropdown-distance-from-right: 1rem !default;
$search-filter-remove-icon-in-dropdown-padding: 0 !default; $search-filter-remove-icon-in-dropdown-padding: 0 !default;
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
// set general text decoration on filters // set general text decoration on filters
.filters { .filters {
& button, button,
& a { a {
text-decoration: $search-filter-text-decoration; text-decoration: $search-filter-text-decoration;
} }
} }
...@@ -31,24 +31,43 @@ ...@@ -31,24 +31,43 @@
// Outer container for all individual filters // Outer container for all individual filters
.filters { .filters {
padding-left: $active-filters-outer-filters-container-padding-left; padding-left: $active-filters-outer-filters-container-padding-left;
}
// Individual filters' outer container // Individual filters' outer container
// Make this the same height as .reset-filters-btn and other navigation elements // Make this the same height as .reset-filters-btn and other navigation elements
// for better usability - keep '.filters' for specifity (overwriting BS3) // for better usability - keep '.filters' for specifity (overwriting BS3)
.filters .filter-value {
// the background filter value in BS3 is '$list-group-active-bg' // unset BS values for proper focus highlighting of contained anchor
background: $search-filter-values-remove-bg; .filter-value {
height: $navigation-element-default-height; background: transparent;
margin-bottom: $search-filters-margin-bottom; margin: 0;
padding: $search-filters-padding; padding: 0;
&:focus,
&:hover { // define styles for contained anchor
background: $search-filter-remove-hover-bg; a {
color: $search-filter-remove-hover-color; // the background filter value in BS3 is '$list-group-active-bg'
background: $search-filter-values-remove-bg;
display: inline-block;
height: $navigation-element-default-height;
margin-bottom: $search-filters-margin-bottom;
padding: $search-filters-padding;
vertical-align: $search-filter-remove-button-vertical-align;
&:focus,
&:hover {
background: $search-filter-remove-hover-bg;
color: $search-filter-remove-hover-color;
// overwrite outline-offset ('a:focus')
outline-offset: 0;
}
}
} }
} }
// keep '.search-filter-dropdown' for specifity to overwrite BS
.search-filter-dropdown .dropdown-menu .filter-value a {
width: 100%;
}
} }
...@@ -65,16 +84,13 @@ ...@@ -65,16 +84,13 @@
} }
// Set focus and hover styles for individual filter items' // Set focus and hover styles for individual filter items' ('.search-filter-remove')
// outer container ('.filters .filter-value') and filter items ('.search-filter-remove') .search-filter-remove,
.filters .filter-value, .search-filter-remove:visited, {
.search-filter-remove {
color: $search-filter-values-remove-color; color: $search-filter-values-remove-color;
&:focus, &:focus,
&:hover, &:hover {
&:visited:focus,
&:visited:hover {
// Keep '.active-filters' for specifity to overwrite BS // Keep '.active-filters' for specifity to overwrite BS
.active-filters & { .active-filters & {
background: $search-filter-remove-hover-bg; background: $search-filter-remove-hover-bg;
...@@ -85,20 +101,7 @@ ...@@ -85,20 +101,7 @@
} }
// Make this same color as un-visited item // Set color of the individual filters when FOCUS is ON OUTER container
&:visited {
// Keep '.active-filters' for specifity to overwrite BS
.active-filters & {
color: inherit;
text-decoration: inherit;
}
}
}
// Set color of individual filters when focus is on outer container
.search-filter-remove,
.search-filter-remove:visited {
.filters .filter-value:focus &, .filters .filter-value:focus &,
.filters .filter-value:hover & { .filters .filter-value:hover & {
background: $search-filter-remove-hover-bg; background: $search-filter-remove-hover-bg;
...@@ -110,13 +113,9 @@ ...@@ -110,13 +113,9 @@
color: $search-filter-remove-icon-hover-color; color: $search-filter-remove-icon-hover-color;
} }
} }
}
// This is the colored, button-like element with the 'x' icon
.search-filter-remove {
// Align with text inside the element
vertical-align: $search-filter-remove-button-vertical-align;
// This is the colored, button-like element with the 'x' icon
.text { .text {
// Create ellipsis for overlong filter text // Create ellipsis for overlong filter text
display: $search-filter-remove-button-text-display; display: $search-filter-remove-button-text-display;
...@@ -130,6 +129,8 @@ ...@@ -130,6 +129,8 @@
// Set icon content // Set icon content
&::after { &::after {
content: $search-filter-remove-icon; content: $search-filter-remove-icon;
display: $search-filter-remove-icon-display;
margin-top: $search-filter-remove-icon-top-margin;
vertical-align: $search-filter-remove-icon-vertical-align; vertical-align: $search-filter-remove-icon-vertical-align;
// Move 'x' to the right of the buttons in dropdown // Move 'x' to the right of the buttons in dropdown
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment