Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is that possible to change the Arwes animate color by theme.js? #15

Closed
ReactGirl opened this issue Feb 18, 2019 · 1 comment
Closed
Assignees

Comments

@ReactGirl
Copy link

ReactGirl commented Feb 18, 2019

I noticed you can for example change the primary color passing the theme object:

const myTheme = {
  animTime: 250,
    color: {
      primary: {
        base: '#be26fc',
        dark: '#8e1bbd',
        light: '#c95bf6'
    },
}

Is that possible to change the color for the animation provided by animate props of the Arwes container (the raising balls)? I noticed it get the primary base color, so if I changed it to a dark color, it will also affect the other areas.

Im wondering if there is something like:

const myTheme = {
    animated: {
    color: 'green'
   }
}
@romelperez
Copy link
Member

Hi @ReactGirl !

You can change the color theme as you commented.

The raising balls are defined by the Puff component and it styles the balls like this:

...
puff: {
  ...
  width: 1,
  height: 1,
  backgroundColor: rgba(theme.color.primary.base, theme.alpha / 1.5),
  boxShadow: `0 0 ${shadow1}px ${shadow1}px ` + rgba(theme.color.primary.base, theme.alpha / 1.5),
  ...
},
...

Check the source code here: https://github.com/arwesjs/arwes/blob/version1-breakpoint1/src/Puffs/styles.js#L24

It uses this function to change the color alpha, from the polished library. Check it out here: https://polished.js.org/docs/#rgba

So the color depends on two things:

  • theme.color.primary.base color setting
  • theme.alpha color alpha setting

But if you change them, you are going to affect the whole application look.

Currently, there is not a "proper" way to set up a custom color for the balls.

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

No branches or pull requests

2 participants