forked from atomiks/tippyjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add transparent ::after element, refactor styles (atomiks#727)
* feat: add transparent ::after element, refactor styles * test: upload snaphot diff * test: fix functional tests * refactor: move ::after element to separate file * feat: make ::after element inherit box border-color * refactor: make ::after element separate import * feat: change default box border-width to 1px, add after.css to tests,
- Loading branch information
Showing
5 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '../../src/scss/after.scss'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@import './_vars.scss'; | ||
|
||
.#{$namespace-prefix}-box { | ||
border: 1px transparent; | ||
|
||
&[data-placement^='top'] > .#{$namespace-prefix}-arrow { | ||
&::after { | ||
border-top-color: inherit; | ||
border-width: 8px 8px 0; | ||
bottom: -8px; | ||
left: 0; | ||
} | ||
} | ||
|
||
&[data-placement^='bottom'] > .#{$namespace-prefix}-arrow { | ||
&::after { | ||
border-bottom-color: inherit; | ||
border-width: 0 8px 8px; | ||
top: -8px; | ||
left: 0; | ||
} | ||
} | ||
|
||
&[data-placement^='left'] > .#{$namespace-prefix}-arrow { | ||
&::after { | ||
border-left-color: inherit; | ||
border-width: 8px 0 8px 8px; | ||
right: -8px; | ||
top: 0; | ||
} | ||
} | ||
|
||
&[data-placement^='right'] > .#{$namespace-prefix}-arrow { | ||
&::after { | ||
border-width: 8px 8px 8px 0; | ||
left: -8px; | ||
top: 0; | ||
border-right-color: inherit; | ||
} | ||
} | ||
} | ||
|
||
.#{$namespace-prefix}-arrow { | ||
& { | ||
border-color: inherit; | ||
} | ||
|
||
&::after { | ||
content: ''; | ||
z-index: -1; | ||
position: absolute; | ||
border-color: transparent; | ||
border-style: solid; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters