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: #6312 #6346 Tailwind classes for inputswitch and checkbox as styling is broken #6347

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
13 changes: 8 additions & 5 deletions components/doc/checkbox/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import Link from 'next/link';
export function TailwindDoc(props) {
const code = {
basic: `
const Tailwind = {
const Tailwind = {
checkbox: {
root: {
className: ['cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6']
className: classNames('cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6')
},
input: ({ props, context }) => ({
className: [
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
box: ({ props, context }) => ({
className: classNames(
'flex items-center justify-center',
'border-2 w-6 h-6 text-gray-600 rounded-lg transition-colors duration-200',
{
Expand All @@ -22,7 +25,7 @@ const Tailwind = {
'hover:border-blue-500 dark:hover:border-blue-400 focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]': !props.disabled,
'cursor-default opacity-60': props.disabled
}
]
)
}),
icon: 'w-4 h-4 transition-all duration-200 text-white text-base dark:text-gray-900'
}
Expand Down
5 changes: 4 additions & 1 deletion components/doc/inputswitch/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import Link from 'next/link';
export function TailwindDoc(props) {
const code = {
basic: `
const Tailwind = {
const Tailwind = {
inputswitch: {
root: ({ props }) => ({
className: classNames('inline-block relative', 'w-12 h-7', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
slider: ({ props }) => ({
className: classNames(
'absolute cursor-pointer top-0 left-0 right-0 bottom-0 border border-transparent',
Expand Down
8 changes: 7 additions & 1 deletion components/lib/passthrough/tailwind/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,9 @@ const Tailwind = {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
slider: ({ props }) => ({
className: classNames(
'absolute cursor-pointer top-0 left-0 right-0 bottom-0 border border-transparent',
Expand Down Expand Up @@ -1048,7 +1051,10 @@ const Tailwind = {
root: {
className: classNames('cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6')
},
input: ({ props, context }) => ({
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
box: ({ props, context }) => ({
className: classNames(
'flex items-center justify-center',
'border-2 w-6 h-6 text-gray-600 rounded-lg transition-colors duration-200',
Expand Down
Loading