Style: chips toolbar compact design with bootstrap specificity fix
- Add bootstrap specificity overrides for input/select in chips toolbar - Use #content.bootstrap selector with doubled classes for specificity - Reduce toolbar height with consistent padding (0.2rem vertical) - Change border-radius from pill to subtle rounded corners - Simplify input structure (embedded search icon via background) - Align all toolbar elements (input, select, count, clear button) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,97 +22,75 @@
|
||||
|
||||
// Chips toolbar - integrated filter bar inside chips area
|
||||
.chips-toolbar {
|
||||
display: none; // Hidden by default, shown via JS when chips exist
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: $es-spacing-xs;
|
||||
flex-wrap: nowrap;
|
||||
gap: $es-spacing-sm;
|
||||
padding: $es-spacing-sm $es-spacing-md;
|
||||
padding-bottom: 0; // No bottom padding - chips will provide spacing
|
||||
background: transparent; // Same as chips area
|
||||
padding-bottom: 0;
|
||||
background: transparent;
|
||||
|
||||
&.has-chips {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter input styled as a search chip - takes available space
|
||||
.chips-filter-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
flex: 1; // Take available space
|
||||
min-width: 0; // Allow shrinking
|
||||
padding: 0.25rem 0.5rem;
|
||||
background: $es-white;
|
||||
border: 1px solid $es-border-color;
|
||||
border-radius: $es-radius-full;
|
||||
transition: all $es-transition-fast;
|
||||
// Filter input - takes available space, icon embedded as background
|
||||
// Using [type="text"] for specificity over .bootstrap input[type="text"]
|
||||
input[type="text"].chips-search-input {
|
||||
all: unset;
|
||||
display: block;
|
||||
flex: 1 1 auto;
|
||||
min-width: 80px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 0.2rem 0.5rem 0.2rem 1.5rem;
|
||||
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.375rem center;
|
||||
background-size: 10px;
|
||||
border: 1px solid $es-slate-300;
|
||||
border-radius: $es-radius-sm;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
color: $es-text-primary;
|
||||
box-sizing: border-box;
|
||||
transition: all $es-transition-fast;
|
||||
|
||||
&:focus-within {
|
||||
border-color: $es-primary;
|
||||
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
|
||||
&::placeholder {
|
||||
color: $es-text-muted;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: $es-primary;
|
||||
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
// Search icon inside the pill
|
||||
> i {
|
||||
color: $es-text-muted;
|
||||
font-size: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
// Sort dropdown - compact, auto width
|
||||
select.chips-sort-select {
|
||||
all: unset;
|
||||
flex: 0 0 auto;
|
||||
padding: 0.2rem 1.25rem 0.2rem 0.5rem;
|
||||
border: 1px solid $es-border-color;
|
||||
border-radius: $es-radius-sm;
|
||||
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23666' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.375rem center;
|
||||
background-size: 8px;
|
||||
font-size: 10px;
|
||||
line-height: 1.4;
|
||||
color: $es-text-secondary;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
|
||||
.chips-search-input,
|
||||
input.chips-search-input,
|
||||
input.chips-search-input[type="text"] {
|
||||
flex: 1 !important;
|
||||
min-width: 60px !important;
|
||||
max-width: none !important; // No max - use available space
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
padding: 0.125rem 0 !important;
|
||||
border: none !important;
|
||||
border-radius: 0 !important;
|
||||
background: transparent !important;
|
||||
font-size: $es-font-size-xs !important;
|
||||
color: $es-text-primary;
|
||||
box-shadow: none !important;
|
||||
&:hover {
|
||||
border-color: $es-primary;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: $es-text-muted;
|
||||
font-size: $es-font-size-xs;
|
||||
}
|
||||
}
|
||||
|
||||
// Sort dropdown for chips
|
||||
.chips-sort-select,
|
||||
select.chips-sort-select {
|
||||
appearance: none;
|
||||
padding: 0.25rem 1.5rem 0.25rem 0.5rem !important;
|
||||
border: 1px solid $es-border-color !important;
|
||||
border-radius: $es-radius-full !important;
|
||||
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23666' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.5rem center !important;
|
||||
background-size: 8px !important;
|
||||
font-size: 11px !important;
|
||||
color: $es-text-secondary;
|
||||
cursor: pointer;
|
||||
transition: all $es-transition-fast;
|
||||
height: auto !important;
|
||||
min-height: 0 !important;
|
||||
line-height: 1.2 !important;
|
||||
|
||||
&:hover {
|
||||
border-color: $es-primary !important;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
border-color: $es-primary !important;
|
||||
box-shadow: 0 0 0 2px rgba($es-primary, 0.1) !important;
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: $es-primary;
|
||||
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,14 +98,16 @@
|
||||
.chips-count {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0; // Don't shrink
|
||||
gap: 0.125rem;
|
||||
padding: 0.125rem 0.5rem;
|
||||
padding: 0.2rem 0.5rem;
|
||||
background: $es-slate-200;
|
||||
color: $es-text-secondary;
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
font-weight: $es-font-weight-semibold;
|
||||
border-radius: $es-radius-full;
|
||||
border-radius: $es-radius-sm;
|
||||
white-space: nowrap;
|
||||
line-height: 1.4;
|
||||
|
||||
&.has-filter {
|
||||
background: $es-cyan-100;
|
||||
@@ -154,16 +134,19 @@
|
||||
// Clear button - subtle, chip-like
|
||||
.btn-chips-clear {
|
||||
@include button-reset;
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0; // Don't shrink
|
||||
gap: 0.25rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
padding: 0.2rem 0.5rem;
|
||||
color: $es-danger;
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
font-weight: $es-font-weight-medium;
|
||||
background: rgba($es-danger, 0.1);
|
||||
border-radius: $es-radius-full;
|
||||
border-radius: $es-radius-sm;
|
||||
transition: all $es-transition-fast;
|
||||
white-space: nowrap; // Prevent text wrapping
|
||||
line-height: 1.4;
|
||||
|
||||
&:hover {
|
||||
background: $es-danger;
|
||||
@@ -171,7 +154,8 @@
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 10px;
|
||||
font-size: 9px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.clear-text {
|
||||
@@ -730,3 +714,74 @@
|
||||
gap: $es-spacing-xs;
|
||||
}
|
||||
}
|
||||
|
||||
// Bootstrap specificity overrides for chips toolbar form elements
|
||||
// PrestaShop admin uses #content .mpr-config-form... with high specificity
|
||||
// We need to match or exceed that specificity
|
||||
#content.bootstrap,
|
||||
#content .bootstrap,
|
||||
.bootstrap #content {
|
||||
.target-conditions-trait,
|
||||
.entity-selector-trait {
|
||||
.chips-wrapper .chips-toolbar {
|
||||
// Double class for extra specificity
|
||||
input[type="text"].chips-search-input.chips-search-input {
|
||||
all: unset;
|
||||
display: block;
|
||||
flex: 1 1 auto;
|
||||
min-width: 80px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 0.2rem 0.5rem 0.2rem 1.5rem;
|
||||
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.375rem center;
|
||||
background-size: 10px;
|
||||
border: 1px solid $es-slate-300;
|
||||
border-radius: $es-radius-sm;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
color: $es-text-primary;
|
||||
box-sizing: border-box;
|
||||
transition: all $es-transition-fast;
|
||||
|
||||
&::placeholder {
|
||||
color: $es-text-muted;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: $es-primary;
|
||||
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
// Double class for extra specificity
|
||||
select.chips-sort-select.chips-sort-select {
|
||||
all: unset;
|
||||
flex: 0 0 auto;
|
||||
padding: 0.2rem 1.25rem 0.2rem 0.5rem;
|
||||
border: 1px solid $es-border-color;
|
||||
border-radius: $es-radius-sm;
|
||||
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23666' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.375rem center;
|
||||
background-size: 8px;
|
||||
font-size: 10px;
|
||||
line-height: 1.4;
|
||||
color: $es-text-secondary;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
height: auto;
|
||||
|
||||
&:hover {
|
||||
border-color: $es-primary;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: $es-primary;
|
||||
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user