Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Support ergonomic merging styles into child components #43

@JAStanton

Description

@JAStanton
const STYLES = dapper.compile({
  root: {
    position: 'relative',
  },
  child: {
    position: 'absolute',
    top: 0,
    left: 0,
  },
});

class Parent extends Component {
  
  styles = dapper.reactTo(this, STYLES);

  render() {
    return (
      <div className={this.styles.root}>
        <Child className={this.styles.child} />
      </div>
    );
  }
}

const STYLES2 = dapper.compile({
  root: {
    color: 'red',
  },
});

class Child extends Component {

   styles = dapper.reactTo(this, STYLES2);

  render() {
    return (
      <div className={this.styles.root} />
    );
  }

}

I would expect Child styles to compile to:

.dapper-child-a {
  color: 'red',
  position: 'absolute',
  top: 0,
  left: 0,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions