File size: 2,259 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import { globalStyle, style } from '@vanilla-extract/css'
import { vars } from '../../styles/theme-contract.css'
import { darkThemeClass } from '../../styles/dark-theme.css'

export const externalLinkIcon = style({
  position: 'absolute',
  top: 16,
  right: 20,
  height: 24,
  width: 24,
  background: 'url(/images/icons/ArrowSquareOutBlue.png)',
  backgroundRepeat: 'no-repeat',
  backgroundSize: 'cover',
  backgroundPosition: 'center',
  zIndex: vars.zIndices['1'],
  mixBlendMode: 'difference',

  '@media': {
    '(hover:hover)': {
      ':hover': {
        opacity: 0,
      },
    },

    '(prefers-reduced-motion: no-preference)': {
      transition: 'opacity 250ms ease-out',
    },
  },

  [`${darkThemeClass} &`]: {
    background: 'url(/images/icons/ArrowSquareOutRed.png)',
    backgroundRepeat: 'no-repeat',
    backgroundSize: 'cover',
    backgroundPosition: 'center',
  },
})

export const exampleAnchor = style({
  textDecoration: 'none',
  zIndex: 0,
  position: 'relative',

  ':focus-visible': {
    boxShadow: 'none',
  },
})

globalStyle(`${exampleAnchor}:focus-visible ${externalLinkIcon}`, {
  opacity: 1,
  boxShadow: '0 0 0 3px $red-outline',
  outline: 'none',
  borderRadius: vars.radii.r4,
  WebkitTapHighlightColor: `3px solid ${vars.colors['red-outline']}`,
})

globalStyle(`${exampleAnchor}:hover ${externalLinkIcon}`, {
  '@media': {
    '(hover:hover)': {
      opacity: 1,
    },
  },
})

export const exampleCard = style({
  backgroundColor: vars.colors.codeBackground,
  margin: 0,
  position: 'relative',
  borderRadius: vars.radii.r8,
  overflow: 'hidden',
})

export const exampleContent = style({
  padding: vars.space['20'],
})

export const exampleDescription = style({
  display: 'flex',
  flexDirection: 'column',
  gap: 4,
  marginBottom: vars.space['10'],
})

globalStyle(`${exampleDescription} > span + span`, {
  color: vars.colors.steel40,
})

export const exampleTags = style({
  listStyle: 'none',
  margin: 0,
  padding: 0,
  display: 'flex',
  gap: vars.space['10'],
  flexWrap: 'wrap',
})

export const exampleTag = style({
  selectors: {
    '&:hover::before': {
      filter: 'none !important',
    },
  },
})

globalStyle(`${exampleTag} > span`, {
  backgroundColor: vars.colors.codeBackground,
})