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

Drawer component #2

Open
reboottime opened this issue Feb 6, 2024 · 0 comments
Open

Drawer component #2

reboottime opened this issue Feb 6, 2024 · 0 comments

Comments

@reboottime
Copy link
Owner

reboottime commented Feb 6, 2024

Drawer

Drawer has different entering directions, from top down, bottom up, or left in or right in.

@tailwind utilities;

@layer utilities {
  .drawer {
    @apply fixed z-50 overflow-hidden bg-white transition-all;
  }

  .drawer--full {
    @apply w-full max-w-[768px];
  }

  .drawer--left-in {
    @apply h-screen -left-[100%] top-0;
  }

  .drawer--left-in.is-visible {
    @apply top-0 left-0;
  }

  .drawer--right-in {
    @apply h-screen -right-[100%] top-0;
  }

  .drawer--right-in.is-visible {
    @apply right-0;
  }

  .drawer--bottom-in {
    @apply w-full max-h-[60%] -bottom-[100%] left-0;
  }
  .drawer--bottom-in.is-visible {
    @apply bottom-0;
  }

  .drawer--top-in {
    @apply w-full max-h-[60%] -top-[100%] left-0;
  }

  .drawer--top-in.is-visible {
    @apply top-0;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant