-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:theme): add scrollbar style service of div (#267)
- Loading branch information
Showing
4 changed files
with
36 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
.scrollbar-mixin(@enabled) when(@enabled=true) { | ||
body::-webkit-scrollbar { | ||
height: @scrollbar-width; | ||
width: @scrollbar-height; | ||
.scrollbar-style-mixin(@element-name) { | ||
@{element-name} { | ||
&::-webkit-scrollbar { | ||
height: @scrollbar-width; | ||
width: @scrollbar-height; | ||
} | ||
&::-webkit-scrollbar-track { | ||
-webkit-box-shadow: inset 0 0 @scrollbar-width @scrollbar-track-color; | ||
} | ||
&::-webkit-scrollbar-thumb { | ||
background-color: @scrollbar-thumb-color; | ||
outline: 1px solid #333; | ||
} | ||
} | ||
} | ||
|
||
body::-webkit-scrollbar-track { | ||
-webkit-box-shadow: inset 0 0 @scrollbar-width @scrollbar-track-color; | ||
} | ||
// body scrollbar | ||
.scrollbar-mixin(@enabled) when(@enabled=true) { | ||
.scrollbar-style-mixin(body); | ||
} | ||
.scrollbar-mixin(@scrollbar-enabled); | ||
|
||
body::-webkit-scrollbar-thumb { | ||
background-color: @scrollbar-thumb-color; | ||
outline: 1px solid #333; | ||
// 自定义div scrollbar | ||
@scrollbar-prefix: ~'.scrollbar'; | ||
|
||
.scrollbar-style-mixin(@scrollbar-prefix); | ||
@{scrollbar-prefix} { | ||
overflow: auto; | ||
|
||
&-x { | ||
overflow-x: auto; | ||
overflow-y: hidden; | ||
} | ||
&-y { | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
} | ||
} | ||
|
||
.scrollbar-mixin(@scrollbar-enabled); |
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