import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-D-oZzXNK.js";import{r as i}from"./react-B8jdHdWa.js";import{t as a}from"./mdx-react-shim-8vvjMMnP.js";function o(e){let t={a:`a`,code:`code`,h1:`h1`,hr:`hr`,p:`p`,pre:`pre`,strong:`strong`,...i(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{title:`Guides/Custom Components/SCSS/Breakpoints`}),`
`,(0,c.jsx)(t.h1,{id:`scss-breakpoints`,children:`SCSS: Breakpoints`}),`
`,(0,c.jsxs)(t.p,{children:[(0,c.jsx)(t.strong,{children:`Note:`}),` Storybook renders this page inside of an `,(0,c.jsx)(t.code,{children:`iframe`}),`! The width taken into account by the media query is that of the `,(0,c.jsx)(t.code,{children:`iframe`}),` and not the full viewport window. Hide Storybook's navigation sidebar (or pop out this page) to preview the media query against the full browser width.`]}),`
`,(0,c.jsx)(t.hr,{}),`
`,(0,c.jsxs)(`details`,{style:{marginBlock:`24px`},children:[(0,c.jsx)(`summary`,{children:`🚧 SCSS Support is experimental 🚧`}),(0,c.jsx)(t.p,{children:`SCSS support was introduced due to the lack of support for LESS in the Next.js app router.`}),(0,c.jsx)(t.p,{children:`Please avoid using it for other purposes, as the API may change or be removed in the future.`})]}),`
`,(0,c.jsxs)(t.p,{children:[`Import `,(0,c.jsx)(t.code,{children:`breakpoints.less`}),` from `,(0,c.jsx)(t.code,{children:`@preply/ds-web-core`}),` and use the breakpoint mixin:`]}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:`language-css`,children:`@use '@preply/ds-web-core/dist/generated/breakpoints' as *;

.container {
    display: flex;
    flex-direction: column;

    @include medium-l {
        flex-direction: row;
    }
}
`})}),`
`,(0,c.jsxs)(t.p,{children:[`Alternatively you can use the `,(0,c.jsx)(t.code,{children:`$breakpoints`}),` map to access the pixel values directly:`]}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:`language-css`,children:`@use '@preply/ds-web-core/dist/generated/breakpoints' as *;

.some-css-class {
    display: flex;
    flex-direction: column;

    @media (min-width: map-get($breakpoints, medium-l)) {
        flex-direction: row;
    }
}
`})}),`
`,(0,c.jsxs)(t.p,{children:[`We recommend using only `,(0,c.jsx)(t.code,{children:`min-width`}),` media queries in order to structure your code with a "mobile first" approach.`]}),`
`,(0,c.jsxs)(t.p,{children:[`Check out this `,(0,c.jsx)(t.a,{href:`https://medium.com/swlh/use-min-width-not-max-width-in-your-css-e6898fcf6a78`,rel:`nofollow`,children:`small article (3 min read)`}),` for a quick explanation why.`]})]})}function s(e={}){let{wrapper:t}={...i(),...e.components};return t?(0,c.jsx)(t,{...e,children:(0,c.jsx)(o,{...e})}):o(e)}var c;e((()=>{c=t(),a(),n()}))();export{s as default};