Parent element padding not included
See original GitHub issueWhen the target element ([data-simplebar="init"]
) has right padding (6px in this case), the .simplebar-scroll-content
should also have the same padding added to the “scrollbar width” padding. Otherwise the native scrollbar becomes visible.
[data-simplebar=“init”] (6px right-padding)
.simplebar-scroll-content (20px right-padding and 26px right-padding)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Ignore parent padding - Stack Overflow
I'm trying to get it to ignore the padding that everything else in the parent div needs.
Read more >CSS to ignore parent padding in 4 lines - Milind Soorya
Solution. Give this below piece of CSS to the element you wish to break out(pun Intended). The max-width is required because otherwise, you...
Read more >How do you ignore a parent padding in CSS? - Quora
Just using a simple CSS id declaration allows you to separate specific parent elements that the “no padding” rule would apply to.
Read more >Oh Hey, Padding Percentage is Based on the Parent ...
I always thought that percentage padding was based on the element itself. So if an element is 1,000 pixels wide with padding-top: 50%...
Read more >box-sizing - CSS: Cascading Style Sheets - MDN Web Docs
If you set an element's width to 100 pixels, that 100 pixels will include any border or padding you added, and the content...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can this perhaps be added to the Caveats section in the README? I had to search to find this, and while the solution was as easy as adding a container, having it on the repo’s homepage would have been helpful.
Hi guys,
I’m not 100% sure that’s the problem you encountered but the solution for this can be seen on this jsfiddle, you can see I applied a
padding-right: 60px
on the container: https://jsfiddle.net/Grsmto/y6fj691y/7/The div on which you apply SimpleBar should be empty of any “layout” css property, otherwise it can break SimpleBar calculations. So if you want to add like, a padding, you’ll have to add an extra container div where you apply your padding.
I don’t want to start trying to “read” the css of the user and try to patch SimpleBar based on that cause it seems like a slippery slope to me (too many scenarios to handle) so I prefer to let that to the user!
Hope this help!