diff --git a/src/components/ft-toggle/ft-toggle.css b/src/components/ft-toggle/ft-toggle.css index eca42b0..872258d 100644 --- a/src/components/ft-toggle/ft-toggle.css +++ b/src/components/ft-toggle/ft-toggle.css @@ -10,13 +10,21 @@ @apply relative cursor-pointer block w-[64px] bg-gray-300 dark:bg-gray-500 p-1 rounded-full mx-2; } .toggle-item { - @apply bg-red-500 rounded-full w-[24px] h-[24px] transition ease-in-out delay-100 p-1; + @apply bg-white rounded-full w-[24px] h-[24px] transition ease-in-out delay-100 p-1 overflow-hidden; } .input { @apply hidden; } -.active { - @apply translate-x-[130%] bg-green-500; +.toggle-item.active { + @apply translate-x-[130%] ; +} + +.toggle-wrapper.active { + @apply bg-green-500; +} + +.toggle-svg { + @apply fill-black; } diff --git a/src/components/ft-toggle/ft-toggle.tsx b/src/components/ft-toggle/ft-toggle.tsx index 269a0c5..cf82dc0 100644 --- a/src/components/ft-toggle/ft-toggle.tsx +++ b/src/components/ft-toggle/ft-toggle.tsx @@ -75,29 +75,30 @@ export class FtToggle { }; } + toggleSvgClasses() { + return { + 'inline-block': this.checked, + 'hidden': !this.checked, + }; + } + render() { return (