Skip to content

Commit

Permalink
animate label on focus for Select element
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSltun committed May 24, 2023
1 parent 5f34a15 commit dbec911
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/palette/src/elements/Select/Select.tsx
Expand Up @@ -198,7 +198,7 @@ const Container = styled(Box)<ContainerProps>`
${props.error && SELECT_STATES.error}
}
&:has(option[value=""]:checked) {
&:not(:focus):has(option[value=""]:checked) {
${props.title &&
css`
color: transparent;
Expand Down
2 changes: 2 additions & 0 deletions packages/palette/src/elements/Select/tokens.ts
Expand Up @@ -26,6 +26,8 @@ export const SELECT_STATES: Record<State, any> = {
+ label {
color: ${themeGet("colors.blue100")};
transform: translateY(-150%);
font-size: ${themeGet("textVariants.xs.fontSize")};
}
&:has(option[value=""]:checked) + label {
Expand Down

0 comments on commit dbec911

Please sign in to comment.