import React from 'react' import { type Meta, type StoryFn } from '@storybook/react' import { Heading } from '~components/Heading' import { Text } from '~components/Text' export default { title: 'Guides/Tailwind/Utility Class References/Modifiers/Media Queries', parameters: { docsLayout: 'fullPage', docs: { a11y: { disable: true }, description: { component: 'Require @kaizen/tailwind and add it into your tailwind config', }, }, }, } satisfies Meta type QueryInfoProps = { selector: string selectorValue: string children: React.ReactElement } const QueryInfo = ({ selector, selectorValue, children }: QueryInfoProps): React.ReactElement => (
Pseudo selector: {selector} Breakpoint: {selectorValue} In this example: {selector}:bg-blue-400 {/* Passing in as children, as dynamically creating the media query with interpolation fails */} {children}
) export const MediaQueries: StoryFn = () => (
These breakpoints activate over a certain screen width. Meaning that bg-blue-400 will be applied when the screen gets wider.
) export const ArbitraryMediaQueries: StoryFn = () => (
Bespoke, one-off media queries can be created with arbitrary values. See the{' '} Tailwind docs{' '} for more info.
Min-width breakpoint (applied when the screen gets wider) In this example: min-[500px]:bg-blue-400
Max-width breakpoint (applied when the screen gets slimmer) In this example: max-[500px]:bg-blue-400
)