-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(text-input): add experimental text-input #1074
Changes from 1 commit
2547bc3
8097044
b6c9b13
c9a64b7
b1d08ac
ed1c3f4
5769b86
afe0c88
9e31963
03164c2
dfbe7c5
1b0e54a
a2f10be
12f0004
a2dcaf0
62778bc
e69435e
ab238d3
76b2195
39f07c3
a924ab6
04eb88f
8405f01
251a072
9f400aa
28f4e87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
@import '../../globals/scss/import-once'; | ||
@import '../form/form'; | ||
|
||
@include exports('text-input') { | ||
@mixin text-input { | ||
.#{$prefix}--text-input { | ||
@include reset; | ||
@include font-family; | ||
|
@@ -90,3 +90,82 @@ | |
} | ||
} | ||
} | ||
|
||
@mixin text-input--experimental { | ||
.#{$prefix}--text-input { | ||
@include reset; | ||
@include typescale('zeta'); | ||
background-color: $field-01; | ||
width: 100%; | ||
height: rem(40px); | ||
padding: 0 $spacing-xl 0 $spacing-md; | ||
color: $text-02; | ||
border: none; | ||
} | ||
|
||
.#{$prefix}--text-input ~ .#{$prefix}--label { | ||
@include typescale('omega'); | ||
padding: 0; | ||
font-weight: 400; | ||
display: block; | ||
padding: $spacing-sm 0 $spacing-3xl 0; | ||
margin: 0; | ||
} | ||
|
||
.#{$prefix}--text-input:required ~ .#{$prefix}--label::after { | ||
content: ' *'; | ||
} | ||
|
||
.#{$prefix}--text-input::-webkit-input-placeholder { | ||
color: $text-03; | ||
} | ||
|
||
.#{$prefix}--text-input:hover { | ||
color: $text-01; | ||
outline: 1px solid $brand-01; | ||
outline-offset: -1px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we could add our standard transition mixin? For both |
||
} | ||
|
||
.#{$prefix}--text-input:focus, | ||
.#{$prefix}--text-input:active { | ||
outline: 2px solid $brand-01; | ||
outline-offset: -2px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh good call. will check 😞 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FIne by me! |
||
} | ||
|
||
.#{$prefix}--text-input:disabled { | ||
cursor: not-allowed; | ||
pointer-events: none; | ||
color: $text-03; | ||
} | ||
alisonjoseph marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.#{$prefix}--text-input:disabled ~ .#{$prefix}--label { | ||
pointer-events: none; | ||
} | ||
|
||
.#{$prefix}--text-input[data-invalid], | ||
.#{$prefix}--text-input:invalid { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
outline: 1px solid $support-01; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. outline should be 2px thick There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
outline-offset: -2px; | ||
box-shadow: none; | ||
} | ||
|
||
.#{$prefix}--text-input[data-invalid] ~ .#{$prefix}--label, | ||
.#{$prefix}--text-input:invalid ~ .#{$prefix}--label { | ||
color: $support-01; | ||
} | ||
|
||
.#{$prefix}--text-input:disabled, | ||
.#{$prefix}--text-input[data-invalid], | ||
.#{$prefix}--text-input:invalid, | ||
.#{$prefix}--text-input[data-loading] { | ||
padding-right: $spacing-3xl; | ||
} | ||
} | ||
|
||
@include exports('text-input') { | ||
@if feature-flag-enabled('components-x') { | ||
@include text-input--experimental; | ||
} @else { | ||
@include text-input; | ||
} | ||
} |
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.
There should be a 1px border on all sides with
$ui-04
as the border colorThere 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.
updated