File size: 2,205 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { createBreakpoints } from "../src/styled-system/breakpoints"

describe("breakpoints", () => {
  test("works", () => {
    const result = createBreakpoints({
      sm: "30em",
      md: "48em",
      lg: "62em",
      xl: "80em",
      "2xl": "96em",
    })

    expect(result.conditions).toMatchInlineSnapshot(`
      {
        "2xl": "@media screen and (min-width: 96rem)",
        "2xlDown": "@media screen and (max-width: 95.9975rem)",
        "2xlOnly": "@media screen and (min-width: 96rem)",
        "lg": "@media screen and (min-width: 62rem)",
        "lgDown": "@media screen and (max-width: 61.9975rem)",
        "lgOnly": "@media screen and (min-width: 62rem) and (max-width: 79.9975rem)",
        "lgTo2xl": "@media screen and (min-width: 62rem) and (max-width: 95.9975rem)",
        "lgToXl": "@media screen and (min-width: 62rem) and (max-width: 79.9975rem)",
        "md": "@media screen and (min-width: 48rem)",
        "mdDown": "@media screen and (max-width: 47.9975rem)",
        "mdOnly": "@media screen and (min-width: 48rem) and (max-width: 61.9975rem)",
        "mdTo2xl": "@media screen and (min-width: 48rem) and (max-width: 95.9975rem)",
        "mdToLg": "@media screen and (min-width: 48rem) and (max-width: 61.9975rem)",
        "mdToXl": "@media screen and (min-width: 48rem) and (max-width: 79.9975rem)",
        "sm": "@media screen and (min-width: 30rem)",
        "smDown": "@media screen and (max-width: 29.9975rem)",
        "smOnly": "@media screen and (min-width: 30rem) and (max-width: 47.9975rem)",
        "smTo2xl": "@media screen and (min-width: 30rem) and (max-width: 95.9975rem)",
        "smToLg": "@media screen and (min-width: 30rem) and (max-width: 61.9975rem)",
        "smToMd": "@media screen and (min-width: 30rem) and (max-width: 47.9975rem)",
        "smToXl": "@media screen and (min-width: 30rem) and (max-width: 79.9975rem)",
        "xl": "@media screen and (min-width: 80rem)",
        "xlDown": "@media screen and (max-width: 79.9975rem)",
        "xlOnly": "@media screen and (min-width: 80rem) and (max-width: 95.9975rem)",
        "xlTo2xl": "@media screen and (min-width: 80rem) and (max-width: 95.9975rem)",
      }
    `)
  })
})