Skip to content

Commit 0a1f992

Browse files
authored
Merge pull request #450 from webpack/fix-css
Fix asset handling
2 parents cf931c2 + 4e9d92b commit 0a1f992

File tree

19 files changed

+67
-66
lines changed

19 files changed

+67
-66
lines changed

components/container/container.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import './container-style';
32

43
export default (props = {}) => {
54
let { className = '' } = props;

components/logo/logo.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import React from 'react';
22
import Logo from '../../assets/site-logo.svg';
3-
// TODO: Without this useless import, the icon in the footer breaks. Very weird.
4-
import '../../assets/icon-square-small.svg';
5-
import './logo-style';
63

74
export default () => {
85
return (

components/navigation/navigation.jsx

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ import React from 'react';
22
import Link from '../link/link';
33
import Container from '../container/container';
44
import Logo from '../logo/logo';
5-
import './navigation-style';
6-
import './search-style';
75

86
// TODO: Maybe by updating the routing scheme later on we can avoid hardcoding this?
97
let Sections = [
10-
{
11-
title: 'Concepts',
12-
url: 'concepts'
8+
{
9+
title: 'Concepts',
10+
url: 'concepts'
1311
},
14-
{
15-
title: 'Guides',
16-
url: 'guides'
12+
{
13+
title: 'Guides',
14+
url: 'guides'
1715
},
18-
{
19-
title: 'Documentation',
16+
{
17+
title: 'Documentation',
2018
url: 'configuration',
2119
children: [
2220
{ title: 'API', url: 'api' },
@@ -25,17 +23,17 @@ let Sections = [
2523
{ title: 'Plugins', url: 'plugins' }
2624
]
2725
},
28-
{
29-
title: 'Donate',
30-
url: '//opencollective.com/webpack'
26+
{
27+
title: 'Donate',
28+
url: '//opencollective.com/webpack'
3129
}
3230
];
3331

3432
// TODO: Move back to using state once we can handle algolia on our own
3533
export default class Navigation extends React.Component {
3634
render() {
3735
let { pageUrl, sections } = this.props;
38-
36+
3937
return (
4038
<header className="navigation">
4139
<Container className="navigation__inner">
@@ -66,15 +64,15 @@ export default class Navigation extends React.Component {
6664
</nav>
6765

6866
<div className="navigation__search">
69-
<input
70-
type="text"
67+
<input
68+
type="text"
7169
className="navigation__search-input"
7270
placeholder="Search documentation…"
7371
onBlur={ this._toggleSearch.bind(this) } />
74-
<button
72+
<button
7573
className="navigation__search-icon icon-magnifying-glass"
7674
onClick={ this._toggleSearch.bind(this) } />
77-
<button
75+
<button
7876
className="navigation__search-icon icon-cross"
7977
onClick={ this._toggleSearch.bind(this) } />
8078
</div>
@@ -126,7 +124,7 @@ export default class Navigation extends React.Component {
126124

127125
/**
128126
* Check if section is active
129-
*
127+
*
130128
* @param {object} section - An object describing the section
131129
* @return {bool} - Whether or not the given section is active
132130
*/
@@ -141,7 +139,7 @@ export default class Navigation extends React.Component {
141139

142140
/**
143141
* Toggle the SidebarMobile component
144-
*
142+
*
145143
* @param {object} e - Native click event
146144
*/
147145
_toggleSidebar(e) {
@@ -153,7 +151,7 @@ export default class Navigation extends React.Component {
153151

154152
/**
155153
* Toggle the search input
156-
*
154+
*
157155
*/
158156
_toggleSearch() {
159157
let container = document.querySelector('.navigation');
@@ -165,11 +163,11 @@ export default class Navigation extends React.Component {
165163

166164
/**
167165
* Expand the search input
168-
*
166+
*
169167
*/
170168
_openSearch() {
171169
let container = document.querySelector('.navigation');
172-
170+
173171
container.classList.add('navigation--search-mode');
174172
}
175173
}

components/page/page.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Sidecar from '../sidecar/sidecar';
66
import Contributors from '../contributors/contributors';
77
import '../../styles';
88
import './page-style';
9+
import '../sidebar/sidebar-style';
910

1011
export default ({ section, page }) => {
1112
let edit = `https://github.com/webpack/webpack.js.org/edit/develop/content/${page.url}.md`;

components/sidebar-item/sidebar-item.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import Link from '../link/link';
3-
import './sidebar-item-style';
43

54
export default class SidebarItem extends React.Component {
65
constructor(props) {

components/sidebar-mobile/sidebar-mobile.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import Link from '../link/link';
3-
import './sidebar-mobile-style';
43

54
let initialTouchPosition = {};
65
let lastTouchPosition = {};
@@ -14,24 +13,24 @@ export default class SidebarMobile extends React.Component {
1413

1514
render() {
1615
return (
17-
<nav
18-
className="sidebar-mobile"
19-
ref={ ref => this.container = ref }
16+
<nav
17+
className="sidebar-mobile"
18+
ref={ ref => this.container = ref }
2019
onTouchStart={this._handleTouchStart.bind(this)}
2120
onTouchMove={this._handleTouchMove.bind(this)}
2221
onTouchEnd={this._handleTouchEnd.bind(this)}>
2322

24-
<div
23+
<div
2524
className="sidebar-mobile__toggle"
2625
onTouchStart={this._handleTouchStart.bind(this)}
2726
onTouchMove={this._handleOpenerTouchMove.bind(this)}
2827
onTouchEnd={this._handleTouchEnd.bind(this)} />
2928

3029
<div className="sidebar-mobile__content">
31-
<i
30+
<i
3231
className="sidebar-mobile__close icon-cross"
3332
onClick={ this._close.bind(this) } />
34-
33+
3534
{ this._getSections() }
3635
</div>
3736
</nav>
@@ -75,10 +74,10 @@ export default class SidebarMobile extends React.Component {
7574
className="sidebar-mobile__section-header"
7675
key={ absoluteUrl }
7776
to={ absoluteUrl }
78-
onClick={ this._close.bind(this) }>
77+
onClick={ this._close.bind(this) }>
7978
<h3>{ section.title }</h3>
8079
</Link>
81-
80+
8281
{ this._getPages(section.pages) }
8382
</div>
8483
);
@@ -104,8 +103,8 @@ export default class SidebarMobile extends React.Component {
104103

105104
return (
106105
<Link
107-
key={ url }
108-
className={ `sidebar-mobile__page ${active ? 'sidebar-mobile__page--active' : ''}` }
106+
key={ url }
107+
className={ `sidebar-mobile__page ${active ? 'sidebar-mobile__page--active' : ''}` }
109108
to={ url }
110109
onClick={ this._close.bind(this) }>
111110
{ page.title }

components/sidebar/sidebar.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import SidebarItem from '../sidebar-item/sidebar-item';
3-
import './sidebar-style';
43

54
export default props => {
65
let { sectionName, pages, currentPage } = props;
@@ -9,8 +8,8 @@ export default props => {
98
<nav className="sidebar">
109
<div className="sidebar__inner">
1110
<h3 className="sidebar-item__version">Version 2.1</h3>
12-
<SidebarItem
13-
url={ `/${sectionName}` }
11+
<SidebarItem
12+
url={ `/${sectionName}` }
1413
title="Introduction"
1514
currentPage= { currentPage }
1615
/>

components/site/site.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ import Footer from '../footer/footer';
66
import SidebarMobile from '../sidebar-mobile/sidebar-mobile';
77
import './site-style';
88
import '../../styles/icon.font.js';
9+
import '../container/container-style.scss';
10+
import '../navigation/navigation-style';
11+
import '../navigation/search-style';
12+
import '../sidebar-mobile/sidebar-mobile-style';
13+
import '../sidebar-item/sidebar-item-style';
14+
import '../logo/logo-style';
915

1016
export default props => {
1117
// Retrieve section data

components/splash-file/splash-file.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import FileSize from 'filesize';
3-
import './splash-file-style';
43

54
export default props => {
65
return (
@@ -10,4 +9,4 @@ export default props => {
109
<b className="splash-file__size">{ FileSize(props.size) }</b>
1110
</div>
1211
);
13-
};
12+
};

components/splash-viz/splash-viz.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Link from '../link/link';
33
import SplashFile from '../splash-file/splash-file';
44
import Icon from '../../assets/icon-square-big.svg';
55
import Modules from '../../assets/modules.png';
6-
import './splash-viz-style';
76

87
export default class SplashViz extends React.Component {
98
constructor(props) {

0 commit comments

Comments
 (0)