Comments (7)
Maybe we can have an hybrid approach and use iframe only when we want responsive queries to apply?
from histoire.
Great idea to put to debate. Thanks.
What is the rationale for not using iframes?
This is how storybook and cypress handle media queries testing so you can bet that browser support is going to stay. Container queries on the other hand are still not used enough to be stable in API.
Using them instead to test Media queries would meant doing some CSS rewriting. I don't mind doing this magic (with sourcemaps of course) if we have a stable API on the other hand.
from histoire.
After discussing it with @Akryum, it cames that iframes would be kinda heavy, especially with several versions of an element in a story, and might slow down the hot reload and the whole page.
But you're right, usage of iframes should also be put to debate! The advantage being that we won't need anything special to handle media queries.
Small example to illustrate, imagine an iframe for each element of this page:
https://vuejs.github.io/ui/#/demo/button
from histoire.
it cames that iframes would be kinda heavy
Specifically for the grid view where 10 or 100s of the component can be displayed at once.
from histoire.
from histoire.
Would be great if we can get some kind of solution for the container queries
from histoire.
This seems to now be commonly supported: https://caniuse.com/css-container-queries
So, the solution would be to just add a css rule on the variant like this:
.variant {
container: variant / size
}
But then you'll have to use the @container
query instead of the @media
query.
ex:
@container (min-width: 720px) {
.child {...}
}
(The usual media query would still work of course) Wdyt?
from histoire.
Related Issues (20)
- Nuxt3 + Vuetify nuxt module : Could not find defaults instance HOT 1
- Nuxt UI <ULink> generates an error HOT 1
- Bug with i18n and translation in component HOT 7
- Changes in `0.17.15` and `responsiveDisabled=true` lead to unexpected behavior HOT 1
- Vuetify button cannot be mounted on story with grid layout HOT 1
- directory import is not supported resolving ES modules imported from csv-parse HOT 1
- Support twoslash
- Nuxt3 Public assets bug HOT 2
- 404 on sponsor page
- Nuxt3 nuxt-modules/icon custom icons not showing HOT 2
- Nuxt3 public assets in layers HOT 5
- Support Vite 4.0+
- Histoire Tailwind css should be in a layer HOT 2
- How to access window variables
- Error: Cannot find module HOT 2
- ReferenceError: indexedDB is not defined HOT 1
- Issue with NuxtIcon color param HOT 1
- Ability to group Variants within a Story
- Support for Vanilla Web Components? HOT 1
- Broken layout on build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from histoire.