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

fix(theme): make select styles consistent with input #3881

Merged
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
5 changes: 5 additions & 0 deletions .changeset/twelve-trains-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

making input and select styling consistent(#3876)
24 changes: 12 additions & 12 deletions packages/core/theme/src/components/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const input = tv({
flat: {
inputWrapper: [
"bg-default-100",
"data-[hover=true]:bg-default-200",
"data-[hover=true]:bg-default-50",
"group-data-[focus=true]:bg-default-100",
],
},
Expand All @@ -84,7 +84,7 @@ const input = tv({
"bg-default-100",
"border-medium",
"border-default-200",
"data-[hover=true]:border-default-400",
"data-[hover=true]:border-default-400 focus-within:border-default-400",
],
value: "group-data-[has-value=true]:text-default-foreground",
},
Expand Down Expand Up @@ -262,8 +262,8 @@ const input = tv({
color: "primary",
class: {
inputWrapper: [
"bg-primary-50",
"data-[hover=true]:bg-primary-100",
"bg-primary-100",
"data-[hover=true]:bg-primary-50",
"text-primary",
"group-data-[focus=true]:bg-primary-50",
"placeholder:text-primary",
Expand All @@ -277,9 +277,9 @@ const input = tv({
color: "secondary",
class: {
inputWrapper: [
"bg-secondary-50",
"bg-secondary-100",
"text-secondary",
"data-[hover=true]:bg-secondary-100",
"data-[hover=true]:bg-secondary-50",
"group-data-[focus=true]:bg-secondary-50",
"placeholder:text-secondary",
],
Expand All @@ -292,12 +292,12 @@ const input = tv({
color: "success",
class: {
inputWrapper: [
"bg-success-50",
"bg-success-100",
"text-success-600",
"dark:text-success",
"placeholder:text-success-600",
"dark:placeholder:text-success",
"data-[hover=true]:bg-success-100",
"data-[hover=true]:bg-success-50",
"group-data-[focus=true]:bg-success-50",
],
input: "placeholder:text-success-600 dark:placeholder:text-success",
Expand All @@ -309,12 +309,12 @@ const input = tv({
color: "warning",
class: {
inputWrapper: [
"bg-warning-50",
"bg-warning-100",
"text-warning-600",
"dark:text-warning",
"placeholder:text-warning-600",
"dark:placeholder:text-warning",
"data-[hover=true]:bg-warning-100",
"data-[hover=true]:bg-warning-50",
"group-data-[focus=true]:bg-warning-50",
],
input: "placeholder:text-warning-600 dark:placeholder:text-warning",
Expand All @@ -326,12 +326,12 @@ const input = tv({
color: "danger",
class: {
inputWrapper: [
"bg-danger-50",
"bg-danger-100",
"text-danger",
"dark:text-danger-500",
"placeholder:text-danger",
"dark:placeholder:text-danger-500",
"data-[hover=true]:bg-danger-100",
"data-[hover=true]:bg-danger-50",
"group-data-[focus=true]:bg-danger-50",
],
input: "placeholder:text-danger dark:placeholder:text-danger-500",
Expand Down
23 changes: 13 additions & 10 deletions packages/core/theme/src/components/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ const select = tv({
flat: {
trigger: [
"bg-default-100",
"data-[hover=true]:bg-default-200",
"group-data-[focus=true]:bg-default-100",
"data-[hover=true]:bg-default-50",
"group-data-[focus=true]:bg-default-50",
],
},
faded: {
trigger: [
"bg-default-100",
"data-[hover=true]:bg-default-200",
"border-medium",
"border-default-200",
"data-[hover=true]:border-default-400",
"data-[hover=true]:border-default-400 data-[focus=true]:border-default-400 data-[open=true]:border-default-400",
],
value: "group-data-[has-value=true]:text-default-foreground",
},
Expand All @@ -59,7 +58,6 @@ const select = tv({
"data-[hover=true]:border-default-400",
"data-[open=true]:border-default-foreground",
"data-[focus=true]:border-default-foreground",
"data-[focus=true]:border-default-foreground",
],
value: "group-data-[has-value=true]:text-default-foreground",
},
Expand Down Expand Up @@ -305,39 +303,44 @@ const select = tv({
variant: "faded",
color: "primary",
class: {
trigger: "data-[hover=true]:border-primary",
trigger:
"data-[hover=true]:border-primary data-[focus=true]:border-primary data-[open=true]:border-primary",
label: "text-primary",
},
},
{
variant: "faded",
color: "secondary",
class: {
trigger: "data-[hover=true]:border-secondary",
trigger:
"data-[hover=true]:border-secondary data-[focus=true]:border-secondary data-[open=true]:border-secondary",
label: "text-secondary",
},
},
{
variant: "faded",
color: "success",
class: {
trigger: "data-[hover=true]:border-success",
trigger:
"data-[hover=true]:border-success data-[focus=true]:border-success data-[open=true]:border-success",
label: "text-success",
},
},
{
variant: "faded",
color: "warning",
class: {
trigger: "data-[hover=true]:border-warning",
trigger:
"data-[hover=true]:border-warning data-[focus=true]:border-warning data-[open=true]:border-warning",
label: "text-warning",
},
},
{
variant: "faded",
color: "danger",
class: {
trigger: "data-[hover=true]:border-danger",
trigger:
"data-[hover=true]:border-danger data-[focus=true]:border-danger data-[open=true]:border-danger",
label: "text-danger",
},
},
Expand Down