joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Theming of the UI #376

Open AWolf81 opened 5 years ago

AWolf81 commented 5 years ago

I think it would be nice to have theming support so the user can change between different themes.

I would start with a light (default) & dark theme - later we can have more themes but two themes is a good starting point.

Light theme will be the current UI styling and dark will be a variant of it.

Proposed theme data structure src/themes/default.js:

export default {
  app: {
    // global app wide styles - can be used everywhere
    background: RAW_COLORS.gray[900],
    text: RAW_COLORS.black,
    textOnBackground: RAW_COLORS.white
  },
  link: { // maybe we could also name this button
    text: RAW_COLORS.blue[700],
    disabled: RAW_COLORS.gray[700], // I think we don't have this - just an example
    hover: RAW_COLORS.purple[700] // not used yet - also an example
  },
  sidebar: {
    background: `linear-gradient(
              85deg,
              ${RAW_COLORS.blue[900]},
              ${RAW_COLORS.blue[700]}
            )`
  }
  // ... other component specific styles ...
};

Describe the solution you'd like

Additional context At the moment, we're updating color constants (using semantic color name) so we have to wait for the PR #326 before we can start this. Here is a Codesandbox with a basic theming example.

Discussion

Notes

osamajandali commented 3 years ago

I want to start working on this

AWolf81 commented 3 years ago

Sure, please give it a shot. I haven't worked on the project for some time.

But if you're having a version to review, please open a draft pull request and I'll have a look.

Semantic colors PR is merged. So there shouldn't be a blocker for this and semantic color names can be used for the themed UI.

If you're having any questions, please let me know.

osamajandali commented 3 years ago

I have only one question before I start the light theme is the existing one, isn't it ? and is there any specific colors for the dark theme ? I can provide design mockup here before I start implementing so we could decide together which colors shall we go with.

Are we gonna have our theme or are we gonna let the users set their colors ?

AWolf81 commented 3 years ago

Yes, the light theme is the existing one.

I would do a fixed color theme, so the user can pick a theme with predefined colors.

I think there are no specific colors for the dark theme. Maybe @joshwcomeau has an idea for prefered colors.

The mockup sounds great.