diff --git a/src/components/styled/rating.css b/src/components/styled/rating.css new file mode 100644 index 00000000000..a06c291b680 --- /dev/null +++ b/src/components/styled/rating.css @@ -0,0 +1,36 @@ +.rating{ + :where(input){ + animation: rating-pop var(--animation-input, 0.25s) ease-out; + @apply appearance-none w-6 h-6 bg-base-content bg-opacity-100; + } + & .rating-hidden{ + @apply w-2 bg-transparent; + } + input:checked ~ input{ + @apply bg-opacity-20; + } + input:focus-visible{ + @apply transition-transform ease-in-out duration-300; + transform: translateY(-.125em); + } + + & input:active:focus{ + animation: none; + } + + & input:active:focus{ + transform: translateY(-.125em); + } +} + +@keyframes rating-pop { + 0% { + transform: translateY(-.125em); + } + 40% { + transform: translateY(-.125em); + } + 100% { + transform: translateY(0); + } +} \ No newline at end of file diff --git a/src/components/unstyled/rating.css b/src/components/unstyled/rating.css new file mode 100644 index 00000000000..40772615ec7 --- /dev/null +++ b/src/components/unstyled/rating.css @@ -0,0 +1,6 @@ +.rating{ + @apply relative inline-flex; + :where(input){ + @apply cursor-pointer; + } +} \ No newline at end of file diff --git a/src/docs/pages/components/rating.vue b/src/docs/pages/components/rating.vue new file mode 100644 index 00000000000..a998286ed89 --- /dev/null +++ b/src/docs/pages/components/rating.vue @@ -0,0 +1,139 @@ + + + + diff --git a/src/utilities/unstyled/rating.css b/src/utilities/unstyled/rating.css new file mode 100644 index 00000000000..3df4b34f1a2 --- /dev/null +++ b/src/utilities/unstyled/rating.css @@ -0,0 +1,14 @@ +.rating{ + &-xs input { + @apply w-3 h-3; + } + &-sm input { + @apply w-4 h-4; + } + &-md input { + @apply w-6 h-6; + } + &-lg input { + @apply w-10 h-10; + } +} \ No newline at end of file