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

JSS Styles rework #139

Merged
merged 40 commits into from
Jun 27, 2017
Merged

JSS Styles rework #139

merged 40 commits into from
Jun 27, 2017

Conversation

nfour
Copy link
Collaborator

@nfour nfour commented Jun 22, 2017

Intention is to further componentize the project, getting away from CSS dependencies.

  • Demonstrate JSS
  • Convert components to JSS
    • BodyContent
    • BodySchema
    • BodySchemaSwitcher
    • ContentContainer
    • CopyButton
    • Description
    • Example
    • ExternalLink
    • Header
    • Indicator
    • Method
    • Navigation
    • NavigationMethod
    • NavigationTag
    • Overlay
    • Page
    • Property
    • PropertyConstraints
    • Response
    • SecurityContainer
    • ServiceContainer
    • Base
    • Demo
    • general/base scss
    • Refactor all variables, themes

Features

  • Modular CSS
  • Static theming support
  • Dynamic theming support
    • Cant support, pending upstream PR's

Deps

  • Removed sass-loader node-sass balloon-css

@nfour
Copy link
Collaborator Author

nfour commented Jun 22, 2017

Examples:

// Foo.styles.js
import { createSheet } from '../../theme'

export const styles = createSheet((theme) => ({
  foo: {
    background: 'transparent',
    color: 'white'
  }
}))
// Foo.js
import { styles } from './Foo.styles'

@styles
export default class Foo extends Component {
  render () {
    const { classes } = this.props

    return <div className={classes.foo}></div>
  }
}

@brendo
Copy link
Contributor

brendo commented Jun 22, 2017

Looking good man, checked it out locally to have a play around 👍

Did you want a hand with the remaining components or happy just knocking them off one by one?

@brendo
Copy link
Contributor

brendo commented Jun 25, 2017

Note JSS and Jest snapshots might need some work.

styled-components/jest-styled-components#29
https://github.com/cssinjs/react-jss/issues/93

@nfour
Copy link
Collaborator Author

nfour commented Jun 25, 2017

The remainder of this MR is busywork, feels like 20% left to do in terms of time put in.

The testing stuff IMO just needs to pass for the components, thus if classNames can be mocked, we will be fine. Snapshotting JSS can come in after those PR's are in, in jest-styled-components.

jest.config.js Outdated
@@ -7,8 +7,9 @@ module.exports = {
'node_modules'
],
moduleNameMapper: {
'balloon-css': '<rootDir>/src/__mocks__/styleMock.js',
'\\.(css|scss)$': '<rootDir>/src/__mocks__/styleMock.js',
'balloon-css': 'identity-obj-proxy',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@brendo brendo merged commit b9ca5dc into temando:master Jun 27, 2017
@nfour nfour changed the title WIP: JSS Styles rework JSS Styles rework Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants