From ca98e3770916e464d3fc69a7409f6c7e41f273b5 Mon Sep 17 00:00:00 2001 From: Bruno Calou Date: Mon, 10 Oct 2022 14:36:10 -0300 Subject: [PATCH 1/3] feat: add dropdown-bottom modifier --- src/components/styled/dropdown.css | 3 + src/components/unstyled/dropdown.css | 3 + .../src/routes/components/dropdown.svelte.md | 57 +++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/src/components/styled/dropdown.css b/src/components/styled/dropdown.css index c607d48086e..0d1473a0e45 100644 --- a/src/components/styled/dropdown.css +++ b/src/components/styled/dropdown.css @@ -1,6 +1,9 @@ .dropdown .dropdown-content { @apply origin-top scale-95 transform transition duration-200 ease-in-out; } +.dropdown-bottom .dropdown-content { + @apply origin-top; +} .dropdown-top .dropdown-content { @apply origin-bottom; } diff --git a/src/components/unstyled/dropdown.css b/src/components/unstyled/dropdown.css index 0e6b398e478..7af5e18a2ad 100644 --- a/src/components/unstyled/dropdown.css +++ b/src/components/unstyled/dropdown.css @@ -16,6 +16,9 @@ .dropdown-right .dropdown-content { @apply left-full top-0 bottom-auto; } +.dropdown-bottom .dropdown-content { + @apply bottom-auto top-auto; +} .dropdown-top .dropdown-content { @apply bottom-full top-auto; } diff --git a/src/docs/src/routes/components/dropdown.svelte.md b/src/docs/src/routes/components/dropdown.svelte.md index 1c54b1329fc..35f970a9bf5 100644 --- a/src/docs/src/routes/components/dropdown.svelte.md +++ b/src/docs/src/routes/components/dropdown.svelte.md @@ -17,6 +17,7 @@ data="{[ { type:'component', class: 'dropdown-content', desc: 'Container for content' }, { type:'modifier', class: 'dropdown-end', desc: 'Aligns to end' }, { type:'modifier', class: 'dropdown-top', desc: 'Open from top' }, + { type:'modifier', class: 'dropdown-bottom', desc: 'Open from bottom' }, { type:'modifier', class: 'dropdown-left', desc: 'Open from left' }, { type:'modifier', class: 'dropdown-right', desc: 'Open from right' }, { type:'modifier', class: 'dropdown-hover', desc: 'Opens on hover too' }, @@ -150,6 +151,62 @@ data="{[ } + + +
{
+`
+ + +
` +}
+
{
+`
+ + +
` +}
+
+ + + +
{
+`
+ + +
` +}
+
{
+`
+ + +
` +}
+
+