mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
Merge pull request #49 from just-boris/master
style: reduce gaps between marks
This commit is contained in:
+3
-3
@@ -5,7 +5,7 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) =
|
||||
const marksKeys = Object.keys(marks);
|
||||
const marksCount = marksKeys.length;
|
||||
const unit = 100 / (marksCount - 1);
|
||||
const markWidth = unit / 2 + '%';
|
||||
const markWidth = unit * 0.9;
|
||||
|
||||
const range = max - min;
|
||||
const elements = marksKeys.map(parseFloat).map((point) => {
|
||||
@@ -16,8 +16,8 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) =
|
||||
[className + '-text-active']: isActived,
|
||||
});
|
||||
|
||||
const style = { width: markWidth };
|
||||
style.left = (point - min) / range * 100 - unit / 4 + '%';
|
||||
const style = { width: markWidth + '%' };
|
||||
style.left = (point - min) / range * 100 - markWidth / 2 + '%';
|
||||
|
||||
return (<span className={markClassName} style={style} key={point}>
|
||||
{marks[point]}
|
||||
|
||||
Reference in New Issue
Block a user