Skip to content

Commit

Permalink
Correção da cor do text input (#165)
Browse files Browse the repository at this point in the history
* fix text input color

* fix color with value
  • Loading branch information
mdlucas authored Nov 7, 2023
1 parent 11ca201 commit 2d91384
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@platformbuilders/fluid-react",
"version": "1.1.1",
"version": "1.1.2",
"private": false,
"description": "Builders React for Fluid Design System",
"keywords": [
Expand Down
16 changes: 10 additions & 6 deletions src/components/TextInput/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type InputProps = {
$hasError: boolean;
};

const primaryMain = getTheme('brand.primary.main');
const dangerMain = getTheme('danger.main');
const textMain = getTheme('danger.main');
const hasError = ifStyle('$hasError');
Expand All @@ -26,11 +27,13 @@ export const PlaceholderLabel = styled.span<PlaceholderLabelProps>`
color: rgba(19, 19, 21, 0.6);
transition: top 0.2s;
${({ $hasValue }) =>
$hasValue &&
'top: 0; font-size: 0.9375rem; margin-bottom: 40px; color: #1e4bd1;'}
${(props) =>
props.$hasValue &&
`top: 0; font-size: 0.9375rem; margin-bottom: 40px; color: ${primaryMain(
props,
)};`}
color: ${(props) => hasError(dangerMain(props), '#1e4bd1')(props)};
color: ${(props) => hasError(dangerMain(props), primaryMain(props))(props)};
`;

export const Input = styled.input<InputProps>`
Expand All @@ -50,15 +53,16 @@ export const Input = styled.input<InputProps>`
}
&:focus {
border-color: ${(props) => hasError(dangerMain(props), '#1e4bd1')(props)};
border-color: ${(props) =>
hasError(dangerMain(props), primaryMain(props))(props)};
outline: none;
}
&:focus + ${PlaceholderLabel} {
top: 0;
font-size: 0.9375rem;
margin-bottom: 40px;
color: ${(props) => hasError(dangerMain(props), '#1e4bd1')(props)};
color: ${(props) => hasError(dangerMain(props), primaryMain(props))(props)};
}
background: #eff1f2;
Expand Down

0 comments on commit 2d91384

Please sign in to comment.