Skip to content

Commit

Permalink
change to postcss + css modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Ding committed Jul 8, 2016
1 parent 28736f9 commit e330da3
Show file tree
Hide file tree
Showing 55 changed files with 135 additions and 131 deletions.
5 changes: 3 additions & 2 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ webpackConfig.postcss = [
add: true,
remove: true,
browsers: ['last 2 versions']
})
// require('postcss-easy-import')({
}),
require('precss')
// require('postcss-partial-import')({
// prefix: '_'
// }),
// require('postcss-mixins'),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"postcss-extend": "^1.0.1",
"postcss-mixins": "^4.0.1",
"postcss-nested": "^1.0.0",
"precss": "^1.4.0",
"pretender": "^1.1.0",
"react-addons-test-utils": "^15.0.0",
"redbox-react": "^1.2.2",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Counter/Counter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import classes from './Counter.scss'
import classes from './Counter.css'

export const Counter = (props) => (
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import DropdownTrigger from './DropdownTrigger';
import DropdownList from './DropdownList';
import DropdownItem from './DropdownItem';
import dropdownManager from './DropdownManager';
import css from './drop-down.scss';
import css from './drop-down.css';

export class Dropdown extends React.Component {
constructor(props, context) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/DropdownItem.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import css from './drop-down-item.scss';
import css from './drop-down-item.css';

export class DropdownItem extends React.Component {

Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/DropdownList.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import DropdownItem from './DropdownItem';
import classnames from 'classnames';
import css from './drop-down-list.scss';
import css from './drop-down-list.css';

export class DropdownList extends React.Component {

Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/DropdownTrigger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import css from './drop-down-trigger.scss';
import css from './drop-down-trigger.css';

export class DropdownTrigger extends React.Component {
render () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import 'src/styles/base/icon-fonts';
@import '../../styles/utils/colors';
@import '../../styles/utils/mixins';
@import '../../styles/base/icon-fonts';

.selectOption {
line-height: 1.75rem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/styles/utils/colors';
@import '../../styles/utils/colors';

.expandedContent {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import 'src/styles/base/icon-fonts';
@import '../../styles/utils/colors';
@import '../../styles/utils/mixins';
@import '../../styles/base/icon-fonts';

.trigger {
display: inline-block;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Dropdown/drop-down.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import '../../styles/utils/mixins';

.container {
@mixin font__proxima-nova-light;
position: relative;
display: inline-block;
}
7 changes: 0 additions & 7 deletions src/components/Dropdown/drop-down.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Googlemap/Googlemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dot from './map-red-dot.svg';
import dot2 from './map-red-dot-2.svg';
import dot3 from './map-red-dot-3.svg';
import dot4 from './map-red-dot-4.svg';
import css from './google-map.scss';
import css from './google-map.css';


const memberOptions = {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Header/NavBar/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import classnames from 'classnames';
import css from './nav-bar.scss';
import css from './nav-bar.css';

export class NavBar extends React.Component {
render () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import 'src/styles/variables/nav-bar';
@import '../../../styles/utils/colors';
@import '../../../styles/utils/mixins';
@import '../../../styles/variables/nav-bar';

.container {
height: $nav_bar_height;
Expand All @@ -27,7 +27,7 @@
}

.name {
@include font__proxima-nova-semibold;
@mixin font__proxima-nova-semibold;
display: inline-block;
width: 65%;
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/NavBarItem/NaveBarItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react';
import {Link} from 'react-router';
import classnames from 'classnames';
import css from './nav-bar-item.scss';
import css from './nav-bar-item.css';

export class NaveBarItem extends React.Component {
static contextTypes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/styles/utils/colors.scss';
@import '../../../styles/utils/colors';

.container {
display: inline;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Title/Title.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import css from './title.scss';
import css from './title.css';

export class Title extends React.Component {
render () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import 'src/styles/variables/title-bar';
@import '../../../styles/utils/colors';
@import '../../../styles/utils/mixins';
@import '../../../styles/variables/title-bar';

.container {
width: 100%;
Expand All @@ -16,7 +16,7 @@
}

.text {
@include font__proxima-nova-light;
@mixin font__proxima-nova-light;
margin: 0;
font-size: 1.65rem;
line-height: 77px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Maps/Mapsliderbar/Mapsliderbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import css from './map-slider-bar.scss';
import css from './map-slider-bar.css';

export class Mapsliderbar extends React.Component {
constructor(props, context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import '../../../styles/utils/colors';
@import '../../../styles/utils/mixins';

.mapControls {
@include font__proxima-nova-regular;
@mixin font__proxima-nova-regular;
position: absolute;
top: 30px;
left: -290px;
Expand All @@ -19,7 +19,7 @@
}

.toggler {
@include font__proxima-nova-thin;
@mixin font__proxima-nova-thin;
position: absolute;
top: 10px;
left: calc(260px + 30px + 30px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import StudentsRiskLevelChart from './StudentsRiskLevelChart';
import classnames from 'classnames';
import Dropdown from 'components/Dropdown';
import _get from 'lodash/object/get';
import css from './students-retention.scss';
import css from './students-retention.css';

export class MembershipsOverviewReportsRetention extends React.Component {
constructor(props, context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
import $ from 'jquery';
import * as d3 from 'd3';
import _debounce from 'lodash/function/debounce';
import css from './students-demographics-chart.scss';
import css from './students-demographics-chart.css';

export class StudentsDemographicsChart extends React.Component {
constructor(props, context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classnames from 'classnames';
import RingChart from 'components/RingChart';
import StudentsDemographicsChart from './StudentsDemographicsChart';
import _get from 'lodash/object/get';
import css from './students-risk-level-chart.scss';
import css from './students-risk-level-chart.css';

const RING_COLOR = {
'low-risk': {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'src/styles/utils/mixins';
@import 'src/styles/utils/colors';
@import '../../../styles/utils/mixins';
@import '../../../styles/utils/colors';

.container {
height: 350px;
Expand All @@ -16,7 +16,7 @@
}

text {
@include font__proxima-nova-light;
@mixin font__proxima-nova-light;
fill: $color_shadow-grey;
stroke: $color_shadow-grey;
shape-rendering: crispEdges;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../Snapshot/snapshot.scss';
@import '../Snapshot/snapshot.css';

.content{
@extend .row;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import 'src/styles/utils/mixins';
@import 'src/styles/utils/colors';
@import '../../../styles/utils/mixins';
@import '../../../styles/utils/colors';

.chart {
@include flex-row;
@mixin flex-row;
margin-top: 30px;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Overview/Snapshot/Snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import classnames from 'classnames';
import Dropdown from 'components/Dropdown';
import _get from 'lodash/object/get';
import css from './snapshot.scss';
import css from './snapshot.css';

export class Snapshot extends React.Component {
constructor(props, context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/styles/utils/colors';
@import '../../../styles/utils/colors';

.snapshot {
min-height: 370px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Overview/StatCard/StatCard.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import css from './stat-card.scss';
import css from './stat-card.css';

export class StatCard extends React.Component {
render () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import '../../../styles/utils/colors';
@import '../../../styles/utils/mixins';

.statCard {
flex: 1;
Expand Down Expand Up @@ -30,7 +30,7 @@
}

.primaryStat {
@include font__proxima-nova-thin ;
@mixin font__proxima-nova-thin ;
font-size: 2.5em;
}

Expand Down Expand Up @@ -59,7 +59,7 @@


.primaryText {
@include font__proxima-nova-semibold;
@mixin font__proxima-nova-semibold;
margin-top: 1em;
font-size: 0.9rem;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tab/Tab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import css from './tab.scss'
import css from './tab.css'

export class Tab extends React.Component {
constructor(props, context) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Tab/tab.scss → src/components/Tab/tab.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'src/styles/utils/colors';
@import 'src/styles/utils/mixins';
@import '../../styles/utils/colors';
@import '../../styles/utils/mixins';

.list {
display: flex;
Expand All @@ -19,7 +19,7 @@
}

.title {
@include font__proxima-nova-semibold;
@mixin font__proxima-nova-semibold;
display: block;
padding: 1em;
font-size: 0.8rem;
Expand Down
2 changes: 1 addition & 1 deletion src/containers/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'
import { Router } from 'react-router'
import { Provider } from 'react-redux';
import dropdownManager from 'components/Dropdown/DropdownManager';
import 'styles/app.scss';
import 'styles/app.css';

class AppContainer extends React.Component {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/CoreLayout/CoreLayout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import Header from 'components/Header'
import classnames from 'classnames';
import css from './core-layout.scss';
import css from './core-layout.css';

export const CoreLayout = ({ children }) => (
<div className={classnames(css.application)}>
Expand Down
5 changes: 5 additions & 0 deletions src/layouts/CoreLayout/core-layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import '../../styles/utils/mixins';

.application {
@mixin font__proxima-nova-regular;
}
5 changes: 0 additions & 5 deletions src/layouts/CoreLayout/core-layout.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/routes/Maps/containers/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { bindActionCreators } from 'redux';
import classnames from 'classnames';
import { fetchMapData } from '../modules/reducer';
import _get from 'lodash/object/get';
import css from './maps.scss';
import css from './maps.css';

import GoogleMap from 'components/GoogleMap';
import Mapsliderbar from 'components/Maps/Mapsliderbar';
Expand Down
Loading

0 comments on commit e330da3

Please sign in to comment.