Skip to content

Conversation

@gdelmas
Copy link
Contributor

@gdelmas gdelmas commented Jan 14, 2019

hey @Quramy,

in this PR you will find a different emit style for type definitions, that would allow for all currently invalid tokens to be defined as well.

the emitted definition for the example would become:

interface Styles {
  primary: string;
  root: string;
  some_id: string;
  main: string;
  'my-class1': string;
  'myclass-2': string;
}

declare const _: Styles;
export = _;

which for currently valid tokens would be no change, yet invalid ones could also be consumed via index access like styles['myclass-2']

import * as styles from './style01.css';

console.log(`<div class="${styles.root + ' ' + styles["my-class1"]}" style="color: ${styles.primary}"></div>`);

what do you think about this change. i could also make it optional, though the question would be if this is needed, as the new definition should be fully backward compatible.

@gdelmas
Copy link
Contributor Author

gdelmas commented Jan 24, 2019

@Quramy what is your general opinion about this?

@gdelmas
Copy link
Contributor Author

gdelmas commented May 3, 2019

closed by #56

@gdelmas gdelmas closed this May 3, 2019
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.

1 participant