1
1
import styled from 'styled-components/macro' ;
2
2
3
3
/**
4
- * The user container creates a vertical-directed flexbox .
5
- * It also centers the content to connect the otherwise unrelated content visually .
4
+ * The user container creates a block that should fully contain the necessary user information .
5
+ * It will push other content, like event cards, below this content.
6
6
*/
7
7
export const UserContainer = styled . div `
8
+ /*width: 100%;*/
9
+ ` ;
10
+
11
+ /**
12
+ * The user container meta element splits the screen in half and put the avatar and user in this half.
13
+ * It creates some emphasis on the user's name and also allows extra information without affecting this positioning.
14
+ */
15
+ export const UserContainerMeta = styled . div `
8
16
display: flex;
9
17
flex-direction: column;
10
18
align-items: center;
11
- color: #6a737d;
19
+ justify-content: flex-end;
20
+ height: 50vh;
12
21
` ;
13
22
14
23
/**
15
- * The user avatar aligns the user's avatar with the name, using flexbox .
16
- * This technique is also applied for the description to center the user's name correctly .
24
+ * The user container info element centers the user's description horizontally .
25
+ * The length of this content does not affect the avatar and name positioning .
17
26
*/
18
- export const UserAvatar = styled . div `
27
+ export const UserContainerInfo = styled . div `
19
28
display: flex;
20
- flex: 1;
21
- align-items: flex-end;
29
+ justify-content: center;
30
+ ` ;
31
+
32
+ /**
33
+ * The user avatar creates a slightly bigger avatar for the user.
34
+ * It's because this is the primary visual symbol of the user itself.
35
+ */
36
+ export const UserAvatar = styled . div `
22
37
padding: 0.5rem;
23
38
font-size: 1.5em;
24
39
` ;
25
40
26
41
/**
27
- * The user's name is also the title of the app and is therefore vertically centered .
28
- * It's positioned with flexbox to achieve this without knowing the sizes of both the avatar and description .
42
+ * The user's name is increased in size and styled to style the title of the page .
43
+ * It's because this is the actual human-identifiable information about the user .
29
44
*/
30
45
export const UserName = styled . h1 `
31
- flex: 0;
32
46
margin: 0;
33
47
padding: 0.5rem;
34
48
text-align: center;
@@ -38,25 +52,20 @@ export const UserName = styled.h1`
38
52
` ;
39
53
40
54
/**
41
- * The user description aligns the user's description with the name, using flexbox.
42
- * Because of this flexbox positioning, the size of the text has no impact on the alignment.
43
- * This technique is also applied for the avatar to center the name correctly.
55
+ * The user's description is styled to make it a bit more readable and to have a max width.
56
+ * This styling will create more visual coherence between the name and description.
44
57
*/
45
58
export const UserDescription = styled . div `
46
- display: flex;
47
- flex: 1;
48
- align-items: flex-start;
49
- justify-content: center;
50
59
margin: 0;
51
60
padding: 0.5rem;
52
- width: 100%;
53
61
max-width: 24em;
54
62
text-align: center;
55
63
line-height: 1.5;
64
+ color: #6a737d;
56
65
` ;
57
66
58
67
/**
59
- * The user description highlight styles a single word within this description.
68
+ * The user's description highlights styles keywords within this description.
60
69
*/
61
70
export const UserDescriptionHighlight = styled . strong `
62
71
color: #24292e;
0 commit comments