Skip to content

Instantly share code, notes, and snippets.

@MelSumner
Last active March 7, 2018 18:23
Show Gist options
  • Save MelSumner/26d387e5e2f7f3cb66f20bf259cd5f3f to your computer and use it in GitHub Desktop.
Save MelSumner/26d387e5e2f7f3cb66f20bf259cd5f3f to your computer and use it in GitHub Desktop.

What I've tried:

  1. added a theme-service in my addon
  2. added a theme-toggle component in my addon ('theme-toggle.js', 'theme-toggle.hbs', 'theme-toggle.scss' (with an underscore in front)
  3. added a themes.scss (as per the blog post)
  4. added both the component.scss file and the themes.scss file to my addon.scss file.
  5. injected the theme service into the route of the page in the dummy app:
theme: Ember.inject.service('theme-service'),
  1. added the component into a test page in the dummy app:
{{#theme-toggle data-theme="default-second"}}
    <h1>I should be default-second</h1>
{{/theme-toggle}}

{{#theme-toggle data-theme="toolkit-light"}}
    <h1>I should be toolkit-light</h1>
{{/theme-toggle}}

{{#theme-toggle}}
    <h1>I should be what happens if you don't pick one</h1>
{{/theme-toggle}}

All three are rendering with the color defined in default-primary, even though the correct data-theme attribute values are rendering (default-secondary, toolkit-light, default-primary, respectively)

What am I missing? Feels like it should be super obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment