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

add responsive button view ( mobile, tablet, desktop ) in code example block #1053

Merged
merged 3 commits into from
Sep 10, 2023

Conversation

gi4no
Copy link
Contributor

@gi4no gi4no commented Sep 9, 2023

Closes #

📑 Description

adding three view toggle buttons: Mobile, Tablet, and Desktop; same as https://flowbite.com/ code preview.
adding also the meta hideResponsiveButton for hide buttons when don't need it

Screenshot 2023-09-09 at 18 11 11

Status

  • Not Completed
  • Completed

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

ℹ Additional Information

@stackblitz
Copy link

stackblitz bot commented Sep 9, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@shinokada
Copy link
Collaborator

shinokada commented Sep 9, 2023

cc: @jjagielka

Flowbite site uses iFrame and Flowbite-Svelte doesn't. This means some of components are not suitable for this.

Using this PR, some of examples will have a problem:

  • docs/components/card#Horizontal_card
  • docs/components/card#Testimonial_card
  • docs/components/device-mockups#Desktop_mockup This one should be a smaller size.
  • docs/components/device-mockups#Laptop_mockup This one should be a smaller size.
  • docs/components/device-mockups#Tablet_mockup This one should be a smaller size.
  • docs/components/mega-menu#Full_width_with_CTA
  • and more

We need to add the hideResponsiveButton for those examples.

@gi4no
Copy link
Contributor Author

gi4no commented Sep 10, 2023

@shinokada

I actually didn't think that media queries wouldn't work;
if the pr doesn't bring any improvement you can simply reject it 😀

@shinokada
Copy link
Collaborator

I meant we need to use this example by example since some of them break the style.

@gi4no
Copy link
Contributor Author

gi4no commented Sep 10, 2023

@shinokada
I've reviewed all the examples of the components and added the hideResponsiveButtons meta where I believe it's unnecessary (e.g., for headings) or where it was break the style.
I've also rename the meta from hideResponsiveButton to hideResponsiveButtons for consistency.

@vercel
Copy link

vercel bot commented Sep 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-svelte ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 1:03pm
flowbite-svelte-update ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 1:03pm

@shinokada
Copy link
Collaborator

Thank you for your PR.
It's merged.
I look forward to seeing more PRs in the future.

@shinokada
Copy link
Collaborator

I think the current code doesn't give any benefits of having responsive buttons since the styles don't change.
All the examples having responsive buttons do not change any styles.
Is there any way to make it responsive?

@gi4no
Copy link
Contributor Author

gi4no commented Sep 10, 2023

The only solution would be to implement an iframe similar to what's used on the flowbite.com website. While Tailwind CSS also offers container-based breakpoints, this approach presents issues when working with the components directly. I conducted some experiments to generate iframes using the current codebase and successfully replicated the components within the iframe. However, the JavaScript logic (such as clicks, etc.) is missing. Do you believe it would be possible to reach out to the creators of the mdsvex library and inquire if they can provide a solution for this matter?

@gi4no
Copy link
Contributor Author

gi4no commented Sep 10, 2023

@shinokada

I believe I've come up with a creative solution! 😱
What's the best way to shot it to you? Should I open a new PR?

@shinokada
Copy link
Collaborator

Yes, please create a PR.

@shinokada
Copy link
Collaborator

@gi4no Can you have a look at this issue, please?
#1125 (comment)

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

Successfully merging this pull request may close these issues.

2 participants