Skip to content

Commit

Permalink
Fix attempting to add ::before on scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Saltssaumure committed Mar 24, 2023
1 parent 80b93d5 commit 6a36188
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@parcel/config-default": "^2.8.3",
"@parcel/core": "^2.8.3",
"@parcel/transformer-sass": "^2.8.3",
"@types/node": "^18.15.3",
"salt-bd-scss": "^1.0.0",
"prettier": "^2.8.4",
Expand Down
6 changes: 3 additions & 3 deletions scss/_scrollbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

&::-webkit-scrollbar-thumb {
@include boxes.box;
@include boxes.box($isScrollbar: true);
}

&::-webkit-scrollbar-track {
Expand All @@ -32,7 +32,7 @@
}

&::-webkit-scrollbar-thumb {
@include boxes.box;
@include boxes.box($isScrollbar: true);
background: $grey;
}

Expand All @@ -46,7 +46,7 @@

&:start:decrement,
&:end:increment {
@include boxes.box;
@include boxes.box($isScrollbar: true);
width: 18px;
height: 18px;
}
Expand Down
40 changes: 21 additions & 19 deletions scss/top/_boxes.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "vars-scss" as *;

@mixin box($isInset: false, $isRotate: false) {
@mixin box($isInset: false, $isRotate: false, $isScrollbar: false) {
position: relative;
border: 1px solid;

Expand All @@ -18,28 +18,30 @@
}
}

&::before {
content: " ";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 1px solid;
pointer-events: none;
z-index: 1;

@if $isInset {
border-color: $darkgrey $lightgrey $lightgrey $darkgrey;
}
@if not $isScrollbar {
&::before {
content: " ";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 1px solid;
pointer-events: none;
z-index: 1;

@else {
@if $isRotate {
border-color: $lightgrey $lightgrey $darkgrey $darkgrey;
@if $isInset {
border-color: $darkgrey $lightgrey $lightgrey $darkgrey;
}

@else {
border-color: $lightgrey $darkgrey $darkgrey $lightgrey;
@if $isRotate {
border-color: $lightgrey $lightgrey $darkgrey $darkgrey;
}

@else {
border-color: $lightgrey $darkgrey $darkgrey $lightgrey;
}
}
}
}
Expand Down

0 comments on commit 6a36188

Please sign in to comment.