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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using CSS vars to theme color #5

Closed
AlonsoK28 opened this issue Mar 4, 2020 · 5 comments
Closed

Using CSS vars to theme color #5

AlonsoK28 opened this issue Mar 4, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@AlonsoK28
Copy link

AlonsoK28 commented Mar 4, 2020

Is possible do this?

<ngx-scrolltop [size]="55" color="var(--dark)"></ngx-scrolltop>

Because Ive tried but doesnt work

馃槈

@bartholomej
Copy link
Owner

bartholomej commented Mar 6, 2020

@AlonsoK28 Great idea to use css variables directly 馃憤
I beleive it is possible, but what kind of color are you trying to set?

There are some options for colors: theme (docs), backgroundColor, symbolColor

As you can see here: https://github.com/bartholomej/ngx-scrolltop#component

For your example it could be like this:

<ngx-scrolltop
  [size]="55"
  backgroundColor="var(--dark)"
  symbolColor="#fff">
</ngx-scrolltop>

Let me know how was it ;)

@bartholomej bartholomej added question Further information is requested enhancement New feature or request labels Mar 6, 2020
@bartholomej bartholomej self-assigned this Mar 6, 2020
@AlonsoK28
Copy link
Author

AlonsoK28 commented Mar 7, 2020

Iam using auxilary class for Boostrap 4 colors but doesnt works 馃槶

<ngx-scrolltop [size]="55" theme="var(--primary)" backgroundColor="var(--primary)" symbolColor="var(--primary)"></ngx-scrolltop>

@bartholomej
Copy link
Owner

@AlonsoK28 OK, so I realized there was a "bug" in Angular 8, but it works in Angular 9.

As you can see here:
https://stackblitz.com/edit/ngxscrolltop-cssvariables?file=src/app/app.component.html

@AlonsoK28
Copy link
Author

Thanks a lot. I'm going to try. 馃榿

@AlonsoK28
Copy link
Author

working on ng 9 perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants