Skip to content

Commit 29a839a

Browse files
committed
🐛 Attempt to fix theme bug on first load -1
1 parent 3ed660c commit 29a839a

File tree

7 files changed

+154
-53
lines changed

7 files changed

+154
-53
lines changed

doc/gatsby-node.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,32 @@
55
*/
66

77
// You can delete this file if you're not using it
8+
// const path = require('path');
9+
10+
// exports.onCreateWebpackConfig = ({
11+
// actions, stage,
12+
// }) => {
13+
// const { setWebpackConfig } = actions;
14+
// const PRODUCTION = stage !== 'develop';
15+
16+
// const sassLoader = PRODUCTION ?
17+
// 'sass-loader' :
18+
// `${require.resolve('sass-loader')}?sourceMap`;
19+
20+
// const styleLoader = [
21+
// 'style-loader',
22+
// sassLoader,
23+
// ];
24+
25+
// setWebpackConfig({
26+
// module: {
27+
// rules: [
28+
// {
29+
// test: /\.scss$/,
30+
// include: path.resolve(__dirname, './doc'),
31+
// use: styleLoader,
32+
// },
33+
// ],
34+
// },
35+
// });
36+
// };

doc/package-lock.json

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
"build": "gatsby build",
2525
"develop": "gatsby develop",
2626
"format": "prettier --write '**/*.js'",
27-
"test": "echo \"Error: no test specified\" && exit 1"
27+
"test": "echo \"Error: no test specified\" && exit 1",
28+
"http-server": "rm -rf ./cache && rm -rf ./public && npm run build && http-server ./public"
2829
},
2930
"devDependencies": {
31+
"http-server": "^0.11.1",
3032
"prettier": "^1.14.2"
3133
},
3234
"repository": {

doc/src/components/header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
55
import { Link } from 'gatsby';
66
import Navbar from '../../../lib/navbar';
77
import liteLogo from '../images/match.svg';
8-
import theme from './theme.scss';
8+
import theme from './theme.module.scss';
99

1010
const Header = ({ location }) => (
1111
<Navbar theme={theme} className={`navbar${location.pathname !== '/' ? ' navbar-extended' : ''}`} position="fixed" flat title={<Link to="/">React Lite UI</Link>} leftIcon={<Link to="/"><img src={liteLogo} alt="navbar-left-logo" /></Link>}>

doc/src/components/styles.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,26 @@
2828
width: 100%;
2929
background: #e09b2d
3030
}
31+
}
32+
33+
div[class*=navlinks] {
34+
a {
35+
&:hover {
36+
background: transparent;
37+
&::after {
38+
content: '';
39+
display: block;
40+
height: 3px;
41+
width: 100%;
42+
background: #e09b2d
43+
}
44+
}
45+
46+
&::after {
47+
content: '';
48+
display: block;
49+
height: 3px;
50+
width: 100%;
51+
}
52+
}
3153
}

doc/src/components/theme.scss

Lines changed: 0 additions & 49 deletions
This file was deleted.

webpack.common.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,19 @@ module.exports = {
4444
],
4545
},
4646
{
47-
test: /\.module\.scss$/,
48-
include: path.resolve(__dirname, './lib'),
47+
test: /\.s(a|c)ss$/,
48+
include: [
49+
path.resolve(__dirname, './lib'),
50+
path.resolve(__dirname, './doc'),
51+
],
52+
use: styleLoader,
53+
},
54+
{
55+
test: /\.module\.s(a|c)ss$/,
56+
include: [
57+
path.resolve(__dirname, './lib'),
58+
path.resolve(__dirname, './doc'),
59+
],
4960
use: styleLoader,
5061
},
5162
{

0 commit comments

Comments
 (0)