-
Notifications
You must be signed in to change notification settings - Fork 10
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
トグルボタンのデザインを変更 #260
トグルボタンのデザインを変更 #260
Conversation
@hirokikondo86 |
これは例えば、子要素(テキスト)の幅に合わせて親要素(ボタン自体)の幅も可変させる様な実装するといいかもねって話ですよね…?👀 |
それができたら理想だね。 |
そうなんですよねー…。 |
@noronaoki |
あ、現状のテキストだと確認ができないため、長めのテキストに変更しておきました🙇♂️ |
@hirokikondo86 これだと例えばONのほうを長めのテキストにしたとき、OFFのほうが短いままだとスイッチしたときボタンの長さがガチャガチャ変わっちゃうよね。 2021-03-18.17.33.49.movなのでこの方式を採るならテキストのelementの横幅を取得して大きい方のwidthに揃えるってのをやらなきゃいけないんだけど、問題は切り替えた後にレンダリングされるから横幅を予め取得する術が無さそうというところかな。 |
memo:
|
52a9dff
to
3bbab8e
Compare
|
@hirokikondo86
|
指摘箇所に追加でテキストのcolorにもdurationを適用しました!🙇♂️ |
また、ボタンの横幅を超えたときのテキストに
が効いていなかったので、追加で修正しときました!🙇♂️ |
@hirokikondo86 LGTM! |
export const LabelText = styled.div` | ||
position: absolute; | ||
width: 100%; | ||
word-break: break-all; | ||
white-space: nowrap; | ||
transition: all 0s 0.3s cubic-bezier(0.47, 0, 0.75, 0.72); | ||
`; | ||
export const ActiveLabelText = styled(LabelText)` | ||
padding-right: 6px; | ||
opacity: 0; | ||
`; | ||
export const InActiveLabelText = styled(LabelText)` | ||
margin-left: 6px; | ||
opacity: 1; | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`;
// ここに改行入れて欲しい
export const
めちゃくちゃ細かいんだけど、みっちり詰めすぎて可読性下がってるので改行挟んで欲しいなー
このファイルの他のところは export const
の上は1行改行含まれてるので...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryokosuge
確かに…!修正しました!
Ref
#121
やったこと
スクショ
Before
After