@t2ca/gatsby-theme-showcase 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/components/header.js
CHANGED
|
@@ -4,36 +4,24 @@ import { jsx } from "theme-ui"
|
|
|
4
4
|
import { Link } from "gatsby"
|
|
5
5
|
import isAbsoluteURL from "is-absolute-url"
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
display: "inline-block",
|
|
9
|
-
px: 0,
|
|
10
|
-
py: 0,
|
|
11
|
-
color: "primary",
|
|
12
|
-
margin: 3,
|
|
13
|
-
textDecoration: "none",
|
|
14
|
-
borderBottom: `2px solid transparent`,
|
|
15
|
-
lineHeight: 2,
|
|
16
|
-
transition: `all .5s ease-in;`,
|
|
17
|
-
"&.active": {
|
|
18
|
-
borderBottom: `1px solid transparent`,
|
|
19
|
-
borderColor: "secondary",
|
|
20
|
-
color: "secondary",
|
|
21
|
-
cursor: "default",
|
|
22
|
-
},
|
|
23
|
-
"&:hover:not(.active)": {
|
|
24
|
-
borderColor: "primary",
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default ({ href, ...props }) => {
|
|
7
|
+
export default ({ href, type = "basic", ...props }) => {
|
|
29
8
|
const isExternal = isAbsoluteURL(href || "")
|
|
30
9
|
if (isExternal) {
|
|
31
10
|
return (
|
|
32
|
-
<a href={href} sx={styles}>
|
|
11
|
+
<a href={href} sx={props.styles}>
|
|
33
12
|
{props}
|
|
34
13
|
</a>
|
|
35
14
|
)
|
|
36
15
|
}
|
|
37
16
|
const to = props.to || href
|
|
38
|
-
return
|
|
17
|
+
return (
|
|
18
|
+
<Link
|
|
19
|
+
{...props}
|
|
20
|
+
to={to}
|
|
21
|
+
sx={{
|
|
22
|
+
variant: `links.${type}`,
|
|
23
|
+
}}
|
|
24
|
+
activeClassName="active"
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
39
27
|
}
|
|
@@ -52,6 +52,89 @@ export default merge(
|
|
|
52
52
|
width: `full`,
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
|
+
links: {
|
|
56
|
+
primary: {
|
|
57
|
+
display: "inline-block",
|
|
58
|
+
px: 0,
|
|
59
|
+
py: 0,
|
|
60
|
+
color: "primary",
|
|
61
|
+
margin: 3,
|
|
62
|
+
textDecoration: "none",
|
|
63
|
+
lineHeight: 1.75,
|
|
64
|
+
position: `relative`,
|
|
65
|
+
"&.active": {
|
|
66
|
+
borderBottom: `1px solid transparent`,
|
|
67
|
+
borderColor: "secondary",
|
|
68
|
+
color: "secondary",
|
|
69
|
+
cursor: "default",
|
|
70
|
+
},
|
|
71
|
+
"&::after": {
|
|
72
|
+
content: '""',
|
|
73
|
+
position: "absolute",
|
|
74
|
+
height: "1px",
|
|
75
|
+
width: 0,
|
|
76
|
+
bottom: 0,
|
|
77
|
+
left: 0,
|
|
78
|
+
bg: "primary",
|
|
79
|
+
transition: `all .25s ease-in-out 0s`,
|
|
80
|
+
},
|
|
81
|
+
"&:hover:not(.active)::after": {
|
|
82
|
+
width: `100%`,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
secondary: {
|
|
86
|
+
display: "inline-block",
|
|
87
|
+
px: 0,
|
|
88
|
+
py: 0,
|
|
89
|
+
color: "primary",
|
|
90
|
+
margin: 3,
|
|
91
|
+
textDecoration: "none",
|
|
92
|
+
lineHeight: 1.75,
|
|
93
|
+
position: `relative`,
|
|
94
|
+
"&.active": {
|
|
95
|
+
borderBottom: `1px solid transparent`,
|
|
96
|
+
borderColor: "secondary",
|
|
97
|
+
color: "secondary",
|
|
98
|
+
cursor: "default",
|
|
99
|
+
},
|
|
100
|
+
"&::after": {
|
|
101
|
+
content: '""',
|
|
102
|
+
position: "absolute",
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: "1px",
|
|
105
|
+
bottom: "0",
|
|
106
|
+
left: "0",
|
|
107
|
+
visibility: "hidden",
|
|
108
|
+
transform: "scaleX(0)",
|
|
109
|
+
transition: "all 0.25s ease-in-out 0s",
|
|
110
|
+
bg: "primary",
|
|
111
|
+
},
|
|
112
|
+
"&:hover:not(.active)::after": {
|
|
113
|
+
visibility: "visible",
|
|
114
|
+
transform: "scaleX(1)",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
basic: {
|
|
118
|
+
display: "inline-block",
|
|
119
|
+
px: 0,
|
|
120
|
+
py: 0,
|
|
121
|
+
color: "primary",
|
|
122
|
+
margin: 3,
|
|
123
|
+
textDecoration: "none",
|
|
124
|
+
borderBottom: `2px solid transparent`,
|
|
125
|
+
lineHeight: 2,
|
|
126
|
+
transition: `all .5s ease-in;`,
|
|
127
|
+
"&.active": {
|
|
128
|
+
borderBottom: `1px solid transparent`,
|
|
129
|
+
borderColor: "secondary",
|
|
130
|
+
color: "secondary",
|
|
131
|
+
cursor: "default",
|
|
132
|
+
},
|
|
133
|
+
"&:hover:not(.active)": {
|
|
134
|
+
borderColor: "primary",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
55
138
|
alerts: {
|
|
56
139
|
error: {
|
|
57
140
|
borderRadius: `sm`,
|