question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

custom border style

See original GitHub issue

Is it possible to add border style to the component? I want to add style for the component with react-swith-bg class and to the component with react-switch-handle class.

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
markusenglundcommented, Oct 13, 2018

You can’t use a border unfortunately, but you can use a box-shadow which can be made to look just like a border. Here’s an example (note the styles.css file). I added the following css:

.react-switch-bg {
  box-shadow: 0px 0px 0px 5px #bada55;
}
.react-switch-handle {
  box-shadow: 0px 0px 0px 5px #abcdef !important;
}

I’d normally recommend using the boxShadow and activeBoxShadow props to adjust the box-shadow though.

0reactions
mikeyamatocommented, Feb 20, 2020

I know this thread is closed but I’m in the same camp as @b-asaf. It would be nice to have the option to directly adjust the other two elements (red arrow) in addition to the two we can now (green arrow).

Screen Shot 2020-02-19 at 20 55 33

BTW, this is a great package. I was pulling my hair out trying to figure out how to customize react-bootstrap’s switch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add custom borders to elements - OpenClassrooms
To set individual borders, use top, right, left, and bottom (ex. border-top-style ). To curve the corners of a border, use border-radius ....
Read more >
border-style - CSS: Cascading Style Sheets - MDN Web Docs
The border-style shorthand CSS property sets the line style for all four sides of an element's border. Try it. CSS Demo: border-style. Reset....
Read more >
Is there a way to make a custom border in CSS?
Yes, there is a way to make custom borders with images. See this: w3schools.com/cssref/… – Azu. Oct 30, 2021 at 18:56.
Read more >
CSS Borders - W3Schools
The CSS border properties allow you to specify the style, width, and color of an ... The border-style property specifies what kind of...
Read more >
28 CSS Border Examples - Free Frontend
Collection of hand-picked free HTML and CSS border code examples. ... Dependencies: -. Demo image: Comic Style Border ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found