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

Wrong space removal in content property #15

Open
ahellqui opened this issue Apr 3, 2021 · 4 comments
Open

Wrong space removal in content property #15

ahellqui opened this issue Apr 3, 2021 · 4 comments
Assignees
Labels

Comments

@ahellqui
Copy link

ahellqui commented Apr 3, 2021

Css-minify currently appears to remove all whitespace from quoted strings, however this is not necessarily desirable in the css content property.

On my page I am using the content property to add an arrow before collapsible elements, however upon minification the resulting element goes from:
image

To:
image

I have confirmed in the minified css file that this is in fact caused by css-minify.

@ahellqui
Copy link
Author

ahellqui commented Apr 3, 2021

I can work on this issue sometime in the next week if you don't feel like fixing it.

@ahellqui
Copy link
Author

ahellqui commented Apr 6, 2021

Never mind, I found out that it doesn't remove whitespace from single quoted strings. Although I guess this could be a bug in itself, I think it would be easier to inform the user to use single quotes if spacing is important. This solution works for me at least.

@ahellqui ahellqui closed this as completed Apr 6, 2021
@DracotMolver
Copy link
Owner

Hi @ahellqui I know you closed the issue. Sorry for the delayed response back. I think it is an issue that must be fixed. Do you have the piece of css you are using that you could share with me? This way I can check against the tests 😄

@ahellqui
Copy link
Author

ahellqui commented Apr 6, 2021

The whole project is public here if you for some reason need access to it, however a minimal reproducible example looks a little bit like this:

html

<p>Text that I want a whitespace before</p>

css

p::before {
    content: "▶ ";  /* I want the whitespace at the end to remain */
}

@ahellqui ahellqui reopened this Apr 6, 2021
@DracotMolver DracotMolver self-assigned this Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants