Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last style ignored if no trailing semi-colon #22

Open
iconifyit opened this issue Nov 6, 2019 · 0 comments
Open

Last style ignored if no trailing semi-colon #22

iconifyit opened this issue Nov 6, 2019 · 0 comments

Comments

@iconifyit
Copy link

In CSS, the trailing terminator (semi-colon) is not required for the last rule. In your code, if the last rule is not terminated with a semi-colon it does not get parsed.

For instance:

 '.st5{fill:none;stroke:#45413c;stroke-linecap:round;stroke-linejoin:round}'

Will be parsed to :

{ '.st5': { 
    children: {},
    attributes: { 
        fill: 'none',
        stroke: '#45413c',
        'stroke-linecap': 'round',
        'stroke-linejoin': 'round' 
}}}

Notice that the rule stroke-linejoin:round is missing. However, if I terminate the rule with a semi-colon, it is parse correctly.

Yes, it is easy enough to add the semi-colon but when using the package on auto-generated styles it isn't always possible.

I found a work-around by simply replacing the closing } with ;} to make sure the last rule is always terminated but this is kind of ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant