Skip to content

Commit

Permalink
Merge pull request #8278 from ever-co/fix/theme-selector-style
Browse files Browse the repository at this point in the history
[Fix] styles for switch theme
  • Loading branch information
evereq authored Sep 27, 2024
2 parents ccd993a + dccb73d commit e63d589
Showing 1 changed file with 83 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -1,74 +1,96 @@
@import 'var';

:host .switch-container {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;

nb-toggle.switch ::ng-deep .toggle {
height: 1.5rem;
width: 3.375rem;
font-family: 'Font Awesome 6 Free' !important;
font-size: .625rem;
display: flex;
align-items: center;
background-color: rgba(126, 126, 143, 0.5);
border-width: 0;
.toggle-switcher{
height: 1rem;
width: 1rem;
}
span {
display: flex;
justify-content: center;
align-items: center;
justify-self: flex-end;
}
nb-toggle.switch ::ng-deep .toggle {
height: 1.5rem;
width: 3.375rem;
font-family: 'Font Awesome 6 Free' !important;
font-size: .625rem;
display: flex;
align-items: center;
background-color: rgba(126, 126, 143, 0.5);
border-width: 0;

nb-icon{
display: none;
}
}
nb-toggle.light ::ng-deep .toggle {
justify-content: end;
&:before {
content: '\f186';
@include nb-rtl(margin-left, .275rem);
@include nb-ltr(margin-right, .275rem);
color: rgba(255, 255, 255, 0.25);
}
span {
&:before {
content: '\f185';
}
}
.toggle-switcher{
@include nb-ltr(margin-left, .25rem);
@include nb-rtl(margin-right, .25rem);
}
}
.toggle-switcher {
height: 1rem;
width: 1rem;
@include nb-rtl(left, 3px !important);
@include nb-ltr(right, 3px !important);
}

nb-toggle.dark ::ng-deep .toggle {
justify-content: flex-start;
&:before {
content: '\f185';
@include nb-ltr(margin-left, .325rem);
@include nb-rtl(margin-right, .325rem);
color: rgba(255, 255, 255, 0.25);
}
span {
&:before {
content: '\f186';
}
}
}
span {
display: flex;
justify-content: center;
align-items: center;
justify-self: flex-end;
}

nb-icon {
display: none;
}
}

nb-toggle.light ::ng-deep .toggle {
justify-content: end;

&:before {
content: '\f186';
position: absolute;
@include nb-rtl(right, 6px);
@include nb-ltr(left, 6px);
color: rgba(255, 255, 255, 0.5);
animation: slide 0.4s ease-out forwards;
}

span {
&:before {
content: '\f185';
}
}

.toggle-switcher {
@include nb-ltr(margin-left, .25rem);
@include nb-rtl(margin-right, .25rem);
}
}

nb-toggle.dark ::ng-deep .toggle {
justify-content: flex-start;

&:before {
content: '\f185';
@include nb-ltr(margin-left, .325rem);
@include nb-rtl(margin-right, .325rem);
color: rgba(255, 255, 255, 0.5);
animation: slide 0.4s ease-out forwards;
}

span {
&:before {
content: '\f186';
}
}
}
}

::ng-deep [dir=ltr] nb-toggle.switch .toggle.checked .toggle-switcher {
left: calc(100% - 1.375rem);
left: calc(100% - 1.375rem);
}

::ng-deep [dir=rtl] nb-toggle.switch .toggle.checked .toggle-switcher {
right: calc(100% - 1.375rem);
right: calc(100% - 1.375rem);
}

@keyframes slide {
from {
transform: translateX(300%);
}
to {
transform: translateX(0%);
}
}

0 comments on commit e63d589

Please sign in to comment.