-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGallery.tsx
More file actions
62 lines (59 loc) · 1.72 KB
/
Gallery.tsx
File metadata and controls
62 lines (59 loc) · 1.72 KB
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
import styled from 'styled-components';
import theme from '../styles/theme';
const { mediaQueryMin } = theme;
const Gallery = styled.section<{
padded?: boolean;
xs?: number;
sm?: number;
md?: number;
lg?: number;
}>`
display: flex;
flex-direction: column;
flex-wrap: wrap;
padding: ${(props) => (props.padded ? '10vh' : 0)} 0;
& > * {
width: 100%;
flex-basis: 100%;
padding: 0.5em;
}
@media (${mediaQueryMin.xs}) {
flex-direction: row;
align-items: center;
& > * {
width: ${(props) => `${props.xs}%` || 'inherit'};
flex-basis: ${(props) => `${props.xs}%` || 'inherit'};
}
}
@media (${mediaQueryMin.sm}) {
padding: ${(props) => (props.padded ? '20vh' : 0)} 0;
& > * {
padding: ${(props) => (props.padded ? '1.33em' : '0.5em')};
width: ${(props) => `${props.sm}%` || 'inherit'};
flex-basis: ${(props) => `${props.sm}%` || 'inherit'};
}
}
@media (${mediaQueryMin.md}) {
& > * {
width: ${(props) => `${props.md}%` || 'inherit'};
flex-basis: ${(props) => `${props.md}%` || 'inherit'};
}
}
@media (${mediaQueryMin.lg}) {
& > * {
width: ${(props) => `${props.lg}%` || 'inherit'};
flex-basis: ${(props) => `${props.lg}%` || 'inherit'};
}
}
@media (${mediaQueryMin.xxl}) {
& > * {
width: ${(props) => `${props.lg}%` || 'inherit'};
flex-basis: ${(props) => `${props.lg}%` || 'inherit'};
padding: 0.5em;
&:first-child {
padding-right: 3em;
}
}
}
`;
export default Gallery;