Skip to content

Commit a2f898b

Browse files
tmorehousejacobmllr95
authored andcommitted
chore(dropdown): switch to :: from : pseudo selectors (#2965)
* chore(dropdown): switch to `::` from `:` psuedo selectors * Update _utilities.scss * Update _dropdown.scss * Create _nav-item-dropdown.scss * Create index.scss * Update index.scss * Update _utilities.scss * Update _dropdown.scss * Create _navbar.scss * Create index.scss * Update index.scss * Update index.scss * Update _nav-item-dropdown.scss * Update _navbar.scss * Update _dropdown.scss * Update index.scss * Update _dropdown.scss * Update _dropdown-text.scss * Update _dropdown-form.scss
1 parent d533630 commit a2f898b

9 files changed

+67
-41
lines changed

src/_utilities.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ $bv-utility-classes-defined: false !default;
44

55
@if $bv-utility-classes-defined == false {
66
// This test will only include these style definitions once
7+
$bv-utility-classes-defined: true;
78

89
// Create .bv-d-<bp>-down-none helper classes
910
@each $breakpoint in map-keys($grid-breakpoints) {
Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
// Custom styles for b-dropdown-form
2-
// Based on class .dropdown-item
1+
$bv-dropdown-form-defined: false !default;
32

4-
.b-dropdown-form {
5-
display: inline-block;
6-
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
7-
width: 100%;
8-
clear: both;
9-
font-weight: $font-weight-normal;
3+
@if $bv-dropdown-form-defined == false {
4+
// This test will only include these style definitions once
5+
$bv-dropdown-form-defined: true;
106

11-
&:first-child {
12-
@include border-top-radius($dropdown-inner-border-radius);
13-
}
7+
// Custom styles for b-dropdown-form
8+
// Based on class .dropdown-item
9+
.b-dropdown-form {
10+
display: inline-block;
11+
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
12+
width: 100%;
13+
clear: both;
14+
font-weight: $font-weight-normal;
15+
16+
&:first-child {
17+
@include border-top-radius($dropdown-inner-border-radius);
18+
}
1419

15-
&:last-child {
16-
@include border-bottom-radius($dropdown-inner-border-radius);
20+
&:last-child {
21+
@include border-bottom-radius($dropdown-inner-border-radius);
22+
}
1723
}
1824
}
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
// Custom styles for b-dropdown-text
2-
// Based on class .dropdown-item
1+
$bv-dropdown-text-defined: false !default;
32

4-
.b-dropdown-text {
5-
display: inline-block;
6-
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
7-
margin-bottom: 0;
8-
width: 100%;
9-
clear: both;
10-
font-weight: $font-weight-lighter;
3+
@if $bv-dropdown-text-defined == false {
4+
// This test will only include these style definitions once
5+
$bv-dropdown-text-defined: true;
116

12-
&:first-child {
13-
@include border-top-radius($dropdown-inner-border-radius);
14-
}
7+
// Custom styles for b-dropdown-text
8+
// Based on class .dropdown-item
9+
.b-dropdown-text {
10+
display: inline-block;
11+
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
12+
margin-bottom: 0;
13+
width: 100%;
14+
clear: both;
15+
font-weight: $font-weight-lighter;
16+
17+
&:first-child {
18+
@include border-top-radius($dropdown-inner-border-radius);
19+
}
1520

16-
&:last-child {
17-
@include border-bottom-radius($dropdown-inner-border-radius);
21+
&:last-child {
22+
@include border-bottom-radius($dropdown-inner-border-radius);
23+
}
1824
}
1925
}

src/components/dropdown/_dropdown.scss

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
// Hide the caret for no-caret setting
2-
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/1473
3-
// See: https://github.com/twbs/bootstrap/issues/23724
4-
.dropdown {
5-
&:not(.dropleft) {
6-
.dropdown-toggle {
7-
&.dropdown-toggle-no-caret:after {
8-
display: none !important;
1+
$bv-dropdown-defined: false !default;
2+
3+
@if $bv-dropdown-defined == false {
4+
// This test will only include these style definitions once
5+
$bv-dropdown-defined: true;
6+
7+
// Hide the caret for no-caret setting
8+
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/1473
9+
// See: https://github.com/twbs/bootstrap/issues/23724
10+
.dropdown {
11+
&:not(.dropleft) {
12+
.dropdown-toggle {
13+
&.dropdown-toggle-no-caret::after {
14+
display: none !important;
15+
}
916
}
1017
}
11-
}
1218

13-
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2909
14-
&.dropleft {
15-
.dropdown-toggle {
16-
&.dropdown-toggle-no-caret:before {
17-
display: none !important;
19+
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2909
20+
&.dropleft {
21+
.dropdown-toggle {
22+
&.dropdown-toggle-no-caret::before {
23+
display: none !important;
24+
}
1825
}
1926
}
2027
}

src/components/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
@import "form-input/index";
55
@import "form-radio/index";
66
@import "input-group/index";
7+
@import "nav/index";
8+
@import "navbar/index";
79
@import "pagination/index";
810
@import "pagination-nav/index";
911
@import "table/index";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "../dropdown/index";

src/components/nav/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "nav-item-dropdown";

src/components/navbar/_navbar.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "../dropdown/index";

src/components/navbar/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "navbar";

0 commit comments

Comments
 (0)