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

Add support for extends #34

Open
RylanH opened this issue Mar 31, 2017 · 0 comments
Open

Add support for extends #34

RylanH opened this issue Mar 31, 2017 · 0 comments

Comments

@RylanH
Copy link
Contributor

RylanH commented Mar 31, 2017

Often times you want have a series of items that are all the same, except for one or two of them are slightly different. Typically you have a common class you use and then you also apply a second class for the special items (i.e. <div class="common special" /><div class="common" /><div class="common" />).

This works fine in dapper using something like classnames <div className={classnames(this.styles.common, this.styles.special)} />.

However it would be easier if we supported extends in the StyleDeclaration:

const STYLES = dapper.compile({
  column: {
    flex:1,
    backgroundColor: '#EEE',
  },
  leftColumn: {
    $$extends: '{.column},
    color: 'red',
  },
});

or something

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant