forked from savulchik/site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpageStyles.sc
More file actions
130 lines (123 loc) · 2.73 KB
/
pageStyles.sc
File metadata and controls
130 lines (123 loc) · 2.73 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
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
import $ivy.`com.lihaoyi::scalatags:0.6.5`
import scalatags.stylesheet._
import scalatags.Text.all._
val marginWidth = "25%"
object WideStyles extends StyleSheet{
initStyleSheet()
override def customSheetName = Some("WideStyles")
def header = cls(
position.fixed,
top := 0,
bottom := 0,
width := marginWidth,
justifyContent.center,
display.flex,
flexDirection.column
)
def tableOfContentsItem = cls(
// We have to use inline-block and verticalAlign.middle and width: 100%
// here, instead of simply using display.block, because display.block items
// with overflow.hidden seem to misbehave and render badly in different ways
// between firefox (renders correctly), chrome (body of list item is offset
// one row from the bullet) and safari (bullet is entirely missing)
display.`inline-block`,
width := "100%",
verticalAlign.middle,
overflow.hidden,
textOverflow.ellipsis
)
def tableOfContents = cls(
display.flex,
flexDirection.column,
flexGrow := 1,
flexShrink := 1,
minHeight := 0,
marginTop := 20,
width := "100%"
)
def headerContent = cls(
textAlign.center
)
def content = cls(
padding := "2em 3em 0",
padding := 48,
marginLeft := marginWidth,
boxSizing.`border-box`
)
def footer = cls(
position.fixed,
bottom := 0,
height := 50,
width := marginWidth
)
}
object NarrowStyles extends StyleSheet{
initStyleSheet()
override def customSheetName = Some("NarrowStyles")
def header = cls(
marginBottom := 10
)
def tableOfContents = cls(display.none)
def content = cls(
padding := 16
)
def headerContent = cls(
flexDirection.row,
width := "100%",
display.flex
)
def linkFlex = cls(
alignSelf.flexEnd
)
def flexFont = cls(
fontSize := "4vw"
)
}
object Styles extends CascadingStyleSheet{
initStyleSheet()
override def customSheetName = Some("Styles")
def hoverBox = cls(
display.flex,
flexDirection.row,
alignItems.center,
justifyContent.spaceBetween,
&hover(
hoverLink(
opacity := 0.5
)
)
)
def hoverLink = cls(
opacity := 0.1,
&hover(
opacity := 1.0
)
)
def headerStyle = cls(
backgroundColor := "rgb(61, 79, 93)",
display.flex,
alignItems.center,
boxSizing.`border-box`
)
def headerLinkBox = cls(
flex := 1,
display.flex,
flexDirection.column,
textAlign.center
)
def headerLink = cls(
flex := 1,
display.flex,
justifyContent.center,
alignItems.center,
padding := "10px 10px"
)
def footerStyle = cls(
display.flex,
justifyContent.center,
color := "rgb(158, 167, 174)"
)
def subtleLink = cls(
textDecoration.none
)
}