Skip to content

Commit fa2cc20

Browse files
committed
consolidate content properties, un-nest
1 parent 468c161 commit fa2cc20

File tree

1 file changed

+55
-50
lines changed

1 file changed

+55
-50
lines changed

scss/_tooltip.scss

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,83 +19,88 @@
1919
display: block;
2020
width: $tooltip-arrow-width;
2121
height: $tooltip-arrow-height;
22-
}
2322

24-
.arrow::before {
25-
position: absolute;
26-
border-color: transparent;
27-
border-style: solid;
23+
&::before {
24+
position: absolute;
25+
content: "";
26+
border-color: transparent;
27+
border-style: solid;
28+
}
2829
}
30+
}
2931

30-
&.bs-tooltip-top {
31-
padding: $tooltip-arrow-height 0;
32-
.arrow {
33-
bottom: 0;
34-
}
32+
.bs-tooltip-top {
33+
padding: $tooltip-arrow-height 0;
3534

36-
.arrow::before {
35+
.arrow {
36+
bottom: 0;
37+
38+
&::before {
3739
top: 0;
38-
content: "";
3940
border-width: $tooltip-arrow-height $tooltip-arrow-width/2 0;
4041
border-top-color: $tooltip-arrow-color;
4142
}
4243
}
43-
&.bs-tooltip-right {
44-
padding: 0 $tooltip-arrow-height;
45-
.arrow {
46-
left: 0;
47-
width: $tooltip-arrow-height;
48-
height: $tooltip-arrow-width;
49-
}
44+
}
45+
46+
.bs-tooltip-right {
47+
padding: 0 $tooltip-arrow-height;
48+
49+
.arrow {
50+
left: 0;
51+
width: $tooltip-arrow-height;
52+
height: $tooltip-arrow-width;
5053

51-
.arrow::before {
54+
&::before {
5255
right: 0;
53-
content: "";
5456
border-width: $tooltip-arrow-width/2 $tooltip-arrow-height $tooltip-arrow-width/2 0;
5557
border-right-color: $tooltip-arrow-color;
5658
}
5759
}
58-
&.bs-tooltip-bottom {
59-
padding: $tooltip-arrow-height 0;
60-
.arrow {
61-
top: 0;
62-
}
60+
}
6361

64-
.arrow::before {
62+
.bs-tooltip-bottom {
63+
padding: $tooltip-arrow-height 0;
64+
65+
.arrow {
66+
top: 0;
67+
68+
&::before {
6569
bottom: 0;
66-
content: "";
6770
border-width: 0 $tooltip-arrow-width/2 $tooltip-arrow-height;
6871
border-bottom-color: $tooltip-arrow-color;
6972
}
7073
}
71-
&.bs-tooltip-left {
72-
padding: 0 $tooltip-arrow-height;
73-
.arrow {
74-
right: 0;
75-
width: $tooltip-arrow-height;
76-
height: $tooltip-arrow-width;
77-
}
74+
}
75+
76+
.bs-tooltip-left {
77+
padding: 0 $tooltip-arrow-height;
78+
79+
.arrow {
80+
right: 0;
81+
width: $tooltip-arrow-height;
82+
height: $tooltip-arrow-width;
7883

79-
.arrow::before {
84+
&::before {
8085
left: 0;
81-
content: "";
8286
border-width: $tooltip-arrow-width/2 0 $tooltip-arrow-width/2 $tooltip-arrow-height;
8387
border-left-color: $tooltip-arrow-color;
8488
}
8589
}
86-
&.bs-tooltip-auto {
87-
&[x-placement^="top"] {
88-
@extend .bs-tooltip-top;
89-
}
90-
&[x-placement^="right"] {
91-
@extend .bs-tooltip-right;
92-
}
93-
&[x-placement^="bottom"] {
94-
@extend .bs-tooltip-bottom;
95-
}
96-
&[x-placement^="left"] {
97-
@extend .bs-tooltip-left;
98-
}
90+
}
91+
92+
.bs-tooltip-auto {
93+
&[x-placement^="top"] {
94+
@extend .bs-tooltip-top;
95+
}
96+
&[x-placement^="right"] {
97+
@extend .bs-tooltip-right;
98+
}
99+
&[x-placement^="bottom"] {
100+
@extend .bs-tooltip-bottom;
101+
}
102+
&[x-placement^="left"] {
103+
@extend .bs-tooltip-left;
99104
}
100105
}
101106

0 commit comments

Comments
 (0)