Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Move theme registration to src #182

Merged
merged 2 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook-css/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { configure } from '@kadira/storybook';
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import aphroditeInterface from 'react-with-styles-interface-aphrodite';
import '../css/rheostat.css';
import registerCSSInterfaceWithDefaultTheme from '../scripts/utils/registerCSSInterfaceWithDefaultTheme';
import registerCSSInterfaceWithDefaultTheme from '../src/utils/registerCSSInterfaceWithDefaultTheme';


/* Register react with styles interface */
Expand Down
2 changes: 1 addition & 1 deletion .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { configure } from '@kadira/storybook';
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import aphroditeInterface from 'react-with-styles-interface-aphrodite';
import registerInterfaceWithDefaultTheme from '../scripts/utils/registerInterfaceWithDefaultTheme';
import registerInterfaceWithDefaultTheme from '../src/utils/registerInterfaceWithDefaultTheme';

/* Register react with styles interface */
registerInterfaceWithDefaultTheme(aphroditeInterface);
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const CleanCSS = require('clean-css');
const compileCSS = require('react-with-styles-interface-css-compiler');
const registerMaxSpecificity = require('react-with-styles-interface-css/dist/utils/registerMaxSpecificity').default;
const registerCSSInterfaceWithDefaultTheme = require('./utils/registerCSSInterfaceWithDefaultTheme').default;
const registerCSSInterfaceWithDefaultTheme = require('../lib/utils/registerCSSInterfaceWithDefaultTheme').default;

const args = process.argv.slice(2);
const optimizeForProduction = args.includes('-o') || args.includes('--optimize');
Expand Down
8 changes: 3 additions & 5 deletions scripts/utils/registerCSSInterfaceWithDefaultTheme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import CSSInterface from 'react-with-styles-interface-css';
/* This file should be removed in the next major version update of Rheostat */

This comment was marked as resolved.


import registerInterfaceWithDefaultTheme from './registerInterfaceWithDefaultTheme';
import registerCSSInterfaceWithDefaultTheme from '../../lib/utils/registerCSSInterfaceWithDefaultTheme';

export default function registerCSSInterfaceWithDefaultTheme() {
registerInterfaceWithDefaultTheme(CSSInterface);
}
export default registerCSSInterfaceWithDefaultTheme;
10 changes: 4 additions & 6 deletions scripts/utils/registerInterfaceWithDefaultTheme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import DefaultTheme from '../../src/themes/DefaultTheme';
/* This file should be removed in the next major version update of Rheostat */

This comment was marked as resolved.


export default function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
ThemedStyleSheet.registerInterface(reactWithStylesInterface);
ThemedStyleSheet.registerTheme(DefaultTheme);
}
import registerInterfaceWithDefaultTheme from '../../lib/utils/registerInterfaceWithDefaultTheme';

export default registerInterfaceWithDefaultTheme;
2 changes: 1 addition & 1 deletion src/initialize.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import registerCSSInterfaceWithDefaultTheme from '../scripts/utils/registerCSSInterfaceWithDefaultTheme';
import registerCSSInterfaceWithDefaultTheme from './utils/registerCSSInterfaceWithDefaultTheme';

registerCSSInterfaceWithDefaultTheme();
7 changes: 7 additions & 0 deletions src/utils/registerCSSInterfaceWithDefaultTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import CSSInterface from 'react-with-styles-interface-css';

import registerInterfaceWithDefaultTheme from './registerInterfaceWithDefaultTheme';

export default function registerCSSInterfaceWithDefaultTheme() {
registerInterfaceWithDefaultTheme(CSSInterface);
}
7 changes: 7 additions & 0 deletions src/utils/registerInterfaceWithDefaultTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import DefaultTheme from '../themes/DefaultTheme';

export default function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
ThemedStyleSheet.registerInterface(reactWithStylesInterface);
ThemedStyleSheet.registerTheme(DefaultTheme);
}