Linkd-Inc / ngx-slideshow

An Agular 2+ slideshow component
5 stars 0 forks source link

Units containing (but not ending) with % don't work for card or padding size #8

Closed crutchcorn closed 6 years ago

crutchcorn commented 6 years ago

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Everything breaks when you have a unit that includes percentage but not at the end of the string

Repro steps

Add calc(20% - 5px) as [cardSize] or [paddingSize]

Desired functionality

Add the ability to use these units without breaking everything

Mention any other details that might be useful

This is currently caused by a lack of using regex (lack of forethought on my part). I will also keep in mind that someone might want to do something like calc(20% - 5%), so the regex and calculation of these percentages should be using a forEach, instead of [0] or something similar