Comments (2)
So the widgetDimensions
would make the svg element 20% of it's container, which by default has no width and there isn't a prop to set that.
widgetSpacings
affects the padding, but it would be hard to get the stars perfectly aligned on one row as you are affecting the padding, and not the width.
I could create a widgetContainerDimensions
prop which would get you partially there (affect the width of the svg container so you can set that to 20%), but you would still need to add in some more custom css.
I suggest ignoring inline styles and just creating your own css. Or maybe keeping the inline styles but add to the defaults via normal css
.widget-ratings {
width: 100%;
display: flex;
justify-content: space-between;
}
Because I am supporting older browsers it would be a lot of work to get it to be evenly spaced on one line, but if you can use flex
than it should be pretty easy to do so.
Would that fix your issue?
from react-ratings-declarative.
When I try to add to the defaults with normal CSS as you suggest, my CSS gets overwritten by the default. I can set properties that the defaults don't set, but I can't overwrite the defaults (e.g., display: flex
). I tried with a simple .css file import and with a module. How would one go about adding to the baked-in CSS?
from react-ratings-declarative.
Related Issues (11)
- Uncaught Error: Cannot find module 'ie-number-polyfill' HOT 4
- Custom svg causing multiple errors in console HOT 1
- Star titles should be hidable
- Ability to hover and set to half star ratings
- Extra vertical height for small values of widgetDimensions
- starSpacings and starSpacing doesn't work HOT 1
- stars randlomly dissapearing after onHover changes
- Partial ratings doesn't get displayed properly on Safari
- Allow extra props for the Widget
- Stars change at different times on hover
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-ratings-declarative.