Skip to content

Commit a725b9f

Browse files
Merge #452
452: Remove !important from scss r=bidoubiwa a=ColinFrick This removes all usages of `!important` from the scss. Additionally it removes the inline styling for `left` and `right` from the dropdown element. Closes #352 Co-authored-by: Colin Frick <[email protected]>
2 parents a9bb524 + dea593b commit a725b9f

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/lib/DocsSearchBar.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ class DocsSearchBar {
135135
},
136136
])
137137

138+
// We remove the inline styles of the wrapper element for left / right
139+
$(`.${this.autocompleteOptions.cssClasses.root} > [role='listbox']`).css({
140+
left: false,
141+
right: false,
142+
})
143+
138144
const customHandleSelected = handleSelected
139145
this.handleSelected = customHandleSelected || this.handleSelected
140146

src/styles/_dropdown.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
// Alignment type
5353
@mixin alignment-type($type) {
5454
@if $type == 'left' {
55-
left: 0 !important;
56-
right: inherit !important;
55+
left: 0;
56+
right: inherit;
5757
}
5858
@if $type == 'right' {
59-
right: 0 !important;
60-
left: inherit !important;
59+
right: 0;
60+
left: inherit;
6161
}
6262
@if $type == 'center' {
63-
left: 0 !important;
64-
right: 0 !important;
65-
margin: auto !important;
63+
left: 0;
64+
right: 0;
65+
margin: auto;
6666
}
6767
}
6868

@@ -473,7 +473,7 @@
473473

474474
&--duplicate-content,
475475
&--subcategory-inline {
476-
display: none !important;
476+
display: none;
477477
}
478478

479479
&--title {

src/styles/_searchbox.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
display: inline-block;
4646
position: relative;
4747
width: $input-width;
48-
height: even-px($input-height) !important;
48+
height: even-px($input-height);
4949
white-space: nowrap;
5050
box-sizing: border-box;
51-
visibility: visible !important;
51+
visibility: visible;
5252

5353
.meilisearch-autocomplete {
5454
display: block;
@@ -71,7 +71,7 @@
7171
border: 0;
7272
border-radius: even-px($border-radius);
7373
box-shadow: inset 0 0 0 $border-width $input-border-color;
74-
background: $input-background !important;
74+
background: $input-background;
7575
padding: 0;
7676
padding-right: if(
7777
$icon-position == 'right',

0 commit comments

Comments
 (0)