File size: 3,442 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import { createVar, globalStyle, style } from '@vanilla-extract/css'
import { vars } from '../../styles/theme-contract.css'
import { BREAKPOINTS } from '../../styles/breakpoints.css'
import { darkThemeClass } from '../../styles/dark-theme.css'

export const mobileHeight = createVar()

export const desktopHeight = createVar()

export const header = style({
  width: '100%',
  paddingTop: vars.space['15'],
  paddingBottom: vars.space['15'],
  zIndex: vars.zIndices['1'],

  '@media': {
    '(prefers-reduced-motion: no-preference)': {
      transition: 'background-color 400ms ease-out',
    },

    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      paddingTop: vars.space['25'],
      paddingBottom: vars.space['25'],
    },
  },
})

export const headerSpacing = style({
  height: mobileHeight,

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      height: desktopHeight,
    },
  },
})

globalStyle(`${header} + aside + main > article > h2`, {
  pointerEvents: 'none',
})

globalStyle(`${header} + aside + main > article > h2::before`, {
  display: 'block',
  content: ' ',
  marginTop: '-48px',
  height: '48px',
  visibility: 'hidden',
  pointerEvents: 'none',

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      marginTop: '-82px',
      height: '82px',
    },
  },
})

export const headerScrolledDown = style({
  backgroundColor: 'rgba(250, 250, 250, 0.80)',
  backdropFilter: 'blur(5px)',

  '@supports': {
    'not (backdrop-filter: blur(10px))': {
      backgroundColor: 'rgba(250, 250, 250, 0.95)',
    },
  },

  selectors: {
    [`${darkThemeClass} &`]: {
      backgroundColor: 'rgba(27, 26, 34, 0.8)',

      '@supports': {
        'not (backdrop-filter: blur(10px))': {
          backgroundColor: 'rgba(27, 26, 34, 0.95)',
        },
      },
    },
  },
})

export const headerStuck = style({
  position: 'fixed',
})

globalStyle(`${headerStuck} + aside + main`, {
  paddingTop: mobileHeight,

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      paddingTop: desktopHeight,
    },
  },
})

export const headerTransparentBackground = style({
  backgroundColor: 'transparent',
  backdropFilter: 'unset',
})

export const headerAddMarginToMain = style({})

globalStyle(`${header} + main`, {
  paddingTop: vars.space['10'],

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      paddingTop: vars.space['20'],
    },
  },
})

export const flexContainer = style({
  display: 'flex',
  flexDirection: 'row-reverse',
  alignItems: 'center',
  justifyContent: 'space-between',
  width: '100%',
  padding: `0 ${vars.space['25']}`,

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      flexDirection: 'row',
      padding: `0 ${vars.space['50']}`,
    },
  },
})

globalStyle(`${flexContainer} + header`, {
  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      display: 'none',
    },
  },
})

export const desktopNavigation = style({
  display: 'none',

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      display: 'flex',
    },
  },
})

export const mobileMenuButton = style({
  margin: 0,
  padding: '0.8rem 0.8rem',
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center',
  cursor: 'pointer',
  border: 'none',
  background: 'none',
  marginLeft: '-0.8rem',

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      display: 'none',
    },
  },
})

export const hamburgerMenu = style({
  color: vars.colors.black,
})