Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(ui-kit): 수민님 디자인 피드백 반영 #42

Merged
merged 2 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui-kit/src/components/Switch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { forwardRef, Ref } from 'react';
import { CombineElementProps } from 'src/types/utils';
import clxs from 'classnames';
import classnames from 'classnames';
import { generateID } from 'src/utils/generateID';
import { Text } from '..';

Expand All @@ -19,12 +19,12 @@ const Switch = (
return (
<label
role="switch"
className={clxs('lubycon-switch', `lubycon-switch--display-${display}`)}
className={classnames('lubycon-switch', `lubycon-switch--display-${display}`)}
style={style}
>
<input className="lubycon-switch--input" ref={ref} type="checkbox" {...props} id={id} />
<span className="lubycon-switch--slider" />
{label ? <Text as="span">{label}</Text> : null}
<input className="lubycon-switch__input" ref={ref} type="checkbox" {...props} id={id} />
<span className="lubycon-switch__slider" />
<span className="lubycon-switch__label">{label ? <Text as="span">{label}</Text> : null}</span>
</label>
);
};
Expand Down
21 changes: 12 additions & 9 deletions ui-kit/src/sass/components/_Switch.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.lubycon-switch {
border-radius: 31.5px;
border-radius: 32px;
display: flex;
align-items: center;
position: relative;
cursor: pointer;

&--input {
&__input {
display: none;
}

&--slider {
&__slider {
position: relative;
width: 40px;
height: 21px;
height: 22px;
margin-right: 8px;
border-radius: 31.5px;
border-radius: 32px;
background-color: get-color('gray40');
transition: background-color 0.3s;

Expand All @@ -23,7 +23,7 @@
position: absolute;
width: 15px;
height: 15px;
left: 3.31px;
left: 4px;
top: 50%;
transform: translateY(-50%);
background-color: #ffffff;
Expand All @@ -32,15 +32,18 @@
}
}

&--input:checked + &--slider {
&__input:checked + &__slider {
background-color: get-color('green50');
}

&--input:checked + &--slider::before {
transform: translate(18.38px, -50%);
&__input:checked + &__slider::before {
transform: translate(17px, -50%);
}

&--display-inline {
display: inline-flex;
}
&__label {
margin-top: -2px;
}
}