-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds shame fixes from MAW to patterns (#1)
* update hgroups * update margin on card-group * init form toggle
- Loading branch information
1 parent
df2f1b0
commit a3d4312
Showing
4 changed files
with
93 additions
and
8 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,5 +1,5 @@ | ||
.card-group { | ||
margin-bottom: 30px; | ||
margin-bottom: 24px; | ||
} | ||
|
||
.card-group__item { | ||
|
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,87 @@ | ||
.form-toggle { | ||
margin-bottom: 12px; | ||
|
||
.form-toggle__label { | ||
// needs higher specifity | ||
// to overcome all digital | ||
display: block; | ||
} | ||
} | ||
|
||
.form-toggle__input > input { | ||
@include visually-hidden; | ||
} | ||
|
||
|
||
.form-toggle__label { | ||
display: block; | ||
position: relative; | ||
outline: none; | ||
user-select: none; | ||
margin-bottom: 0; | ||
|
||
&:before, | ||
&:after { | ||
display: block; | ||
} | ||
|
||
&:before { | ||
width: 54px; | ||
height: 30px; | ||
background-color: $cool-grey8; | ||
border-radius: 30px; | ||
transition: background 0.4s; | ||
content: 'OFF '; | ||
line-height: 30px; | ||
padding-left: 27px; | ||
text-align: center; | ||
font-size: 9px; | ||
font-weight: bold; | ||
color: $white; | ||
} | ||
|
||
&:after { | ||
position: absolute; | ||
width: 24px; | ||
height: 24px; | ||
content: ''; | ||
background-color: $white; | ||
border-radius: 100%; | ||
transition: transform 0.4s; | ||
top: 3px; | ||
margin: 0 3px; | ||
} | ||
|
||
input:checked ~ & { | ||
&:before { | ||
background-color: $blue-sky; | ||
content: 'ON '; | ||
padding-right: 27px; | ||
padding-left: 0; | ||
} | ||
|
||
&:after { | ||
transform: translateX(24px); | ||
} | ||
} | ||
|
||
input:disabled ~ & { | ||
opacity: 0.8; | ||
} | ||
|
||
input:focus ~ & { | ||
&:after { | ||
animation: gradient 0.2s linear 1 forwards; | ||
} | ||
} | ||
} | ||
|
||
@keyframes gradient { | ||
from { | ||
box-shadow: inset 0 0 0 $blue-sky; | ||
} | ||
|
||
to { | ||
box-shadow: inset 0 0 6px $blue-sky; | ||
} | ||
} |