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

How do I style the dots at the bottom? #24

Closed
sanishkr opened this issue Nov 22, 2019 · 9 comments
Closed

How do I style the dots at the bottom? #24

sanishkr opened this issue Nov 22, 2019 · 9 comments
Labels
question Further information is requested

Comments

@sanishkr
Copy link

I am trying to use renderPagination, but I will have to pass a whole new component.
I only want to change the styles of the dots at the bottom. Any way to do that or can you introduce new props?

@sag1v
Copy link
Owner

sag1v commented Nov 24, 2019

Quoting from #23

Most if not all containers and elements has a public CSS class that exposed to the consumer, so you can override or add any styling you like.

In this case you can use the rec-pagination and rec-dot class names.

@sag1v sag1v closed this as completed Nov 24, 2019
@sanishkr
Copy link
Author

Thanks for the response. If I apply styles to those public classes, inline critical css will not be generated for it which is an important requirement for my project.

For styled-components declared css, critcal css is automatically generated.
For now, I am trying a different approach for both issues #23 and #22

@sag1v
Copy link
Owner

sag1v commented Nov 25, 2019

Not sure i understand your issue, can you post an example in codesandbox?

@sag1v sag1v reopened this Nov 25, 2019
@sag1v sag1v assigned sag1v and unassigned sag1v Nov 25, 2019
@sag1v sag1v added the question Further information is requested label Nov 25, 2019
@ec2ainun
Copy link

ec2ainun commented May 8, 2020

any update? @sag1v
https://sag1v.github.io/react-elastic-carousel/renderPagination
perhaps, you can give an example, how Square component styled

@sag1v
Copy link
Owner

sag1v commented May 8, 2020

any update? @sag1v
https://sag1v.github.io/react-elastic-carousel/renderPagination
perhaps, you can give an example, how Square component styled

Its just a component, you can render anything and style it as you wish.

@ec2ainun
Copy link

ec2ainun commented May 8, 2020

any update? @sag1v
https://sag1v.github.io/react-elastic-carousel/renderPagination
perhaps, you can give an example, how Square component styled

Its just a component, you can render anything and style it as you wish.

yeah i know, but i don't know how to style the dots at the bottom while its inactive or active
that why, detailed how to customized the dot at the bottom or provided Square styled component example, will make it clear for us to implement custom style @sag1v

@sag1v
Copy link
Owner

sag1v commented May 8, 2020

You can use the classes .rec-dot and .rec-dot_active to change the style of the dots:

.rec.rec-dot {
  background: #ff4343;
  border: 2px #333 solid;
  border-radius: 0;
}
.rec.rec-dot_active {
  background: #59fd59;
}

see a sandbox example

@sag1v sag1v closed this as completed May 8, 2020
@ec2ainun
Copy link

ec2ainun commented May 9, 2020

thanks its work! @sag1v
but is it possible implementing it using styled component instead?

@sag1v
Copy link
Owner

sag1v commented May 9, 2020

@ec2ainun When you use styled-components you are not passing a class name but creating the actual component.

The example of renderPagination in the docs show this exact case. In this example the Square component is created using styled-components.

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

No branches or pull requests

3 participants