Khan / Khan/aphrodite

Runtime Theming using style variables

Open
#141 21 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
187
PR merge metrics
No merged PRs in 30d

Description

I have been using Radium to do runtime themable components. A bit like how with SASS Bootstrap you have theme variables you can configure ([see Egghead series](https://egghead.io/playlists/react-recompose-theme-with-context-for-ui-library-customization-533a4e94)). This is possible with Aphrodite but if you change colors by dragging sliders etc it generates 100's of css classes for each component.

Ideally I need some way to remove classes that are no longer needed. This looks like it would be hard to track on a component level. Could be a style garbage collector of some kind.

Changing a theme variable probably requires a top down render of the App so I think I can get most of the way there by wiping out the whole aphrodite style tag when a theme variable changes. Is there a library way of doing this? Or should I just use querySelector?

Radium is now struggling to handle Pseudo selectors because of changes in React 15 and seriously considering adopting style tags instead of inline styles:

https://github.com/FormidableLabs/radium/issues/788

So for the two style libraries I like the fact Radium allows me to style at runtime without leaving garbage and that Aphrodite has solid handling of hover states etc. But I don't want to choose between these two features.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by reviewing Aphrodite's runtime style-tag handling and the issue's comparison with Radium; determine whether the requested theme changes require a supported way to remove obsolete generated styles. Done means the project has a decided, library-level approach for runtime theming without accumulating unused CSS classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.