diff --git a/docs/examples/vue3/single-stories.md b/docs/examples/vue3/single-stories.md index 6e481ce1..9a731611 100644 --- a/docs/examples/vue3/single-stories.md +++ b/docs/examples/vue3/single-stories.md @@ -1,10 +1,6 @@ # Single stories -Here are some pattern examples to test your component without any variant. This is the simplest way to get you started. - -## Within an iframe - -This will display your component inside an iframe to be able to test the responsiveness correctly. The iframe is needed for CSS media queries to work properly. +The default way to display stories and variants is inside an iframe that renders a single variant. The iframe is needed for CSS media queries to work properly and to isolate your application's styles. ```vue - - - No iframe story content - -
{content}
-
- -
- - - - -
- - diff --git a/examples/vue3/cypress/e2e/toolbar-background.cy.js b/examples/vue3/cypress/e2e/toolbar-background.cy.js index 91502fb7..2e5179b7 100644 --- a/examples/vue3/cypress/e2e/toolbar-background.cy.js +++ b/examples/vue3/cypress/e2e/toolbar-background.cy.js @@ -23,17 +23,6 @@ describe('background color', () => { 'rgb(0, 81, 66)', ] - it('should provide background and contrast color (no iframe)', () => { - cy.visit('/story/src-components-complexparameter-story-vue?variantId=_default') - cy.get('[data-test-id="toolbar-background"]').click() - cy.get('[data-test-id="background-popper"]').should('be.visible').find('button').should('have.length', 6).each(($el, index) => { - cy.wrap($el).click() - cy.get('[data-test-id="responsive-preview-bg"]').should('have.css', 'background-color', backgroundColorShouldBe[index]) - cy.get('[data-test-id="story-variant-single-view"] .native-story').should('have.css', 'color', contrastColorShouldBe[index]) - cy.get('[data-test-id="toolbar-background"]').click() - }) - }) - it('should provide background and contrast color (with iframe)', () => { cy.visit('story/src-components-contrastcolor-story-vue?variantId=_default') cy.get('[data-test-id="toolbar-background"]').click() @@ -49,8 +38,8 @@ describe('background color', () => { cy.get('[data-test-id="toolbar-background"]').click() cy.get('[data-test-id="background-popper"]').should('be.visible').find('button').should('have.length', 6).each(($el, index) => { cy.wrap($el).click() - cy.get('[data-test-id="responsive-preview-bg"]').should('have.css', 'background-color', backgroundColorShouldBe[index]) - cy.get('.histoire-generic-render-story .text').should('have.css', 'color', contrastColorShouldBe[index]) + getIframeBody().find('[data-test-id="responsive-preview-bg"]').should('have.css', 'background-color', backgroundColorShouldBe[index]) + getIframeBody().find('.histoire-generic-render-story .text').should('have.css', 'color', contrastColorShouldBe[index]) cy.get('[data-test-id="toolbar-background"]').click() }) }) diff --git a/examples/vue3/src/LongFile1.story.md b/examples/vue3/src/LongFile1.story.md index 237575bc..67d411c6 100644 --- a/examples/vue3/src/LongFile1.story.md +++ b/examples/vue3/src/LongFile1.story.md @@ -66,14 +66,11 @@ You can change the layout of the variant by using the `layout` prop with an obje This is the default layout, displaying one variant at a time. The default behavior is to isolate the story with an iframe. -Additional `layout` properties: -- `iframe`: (default: `true`) enables the iframe, useful when your CSS has media queries for responsive design. - ```vue{4}