gulp-clean-css icon indicating copy to clipboard operation
gulp-clean-css copied to clipboard

Relative paths to a picture in selects: after and: before

Open KimonoVIP opened this issue 5 years ago • 3 comments

When I use @import local files in my shared file, the relative paths are broken in the code taken from the included file — the points are deleted. This happens only for selectors: after Here is an example of what is happening: style.css       @import url ('main.css');

The main.css code is initially: .element: after {       background: url ("../ img / icons / pic.svg"); }

And the output in the style.css file is this: .element: after {       background: url (img / icons / pic.svg); } That is, relative paths have been destroyed, and the image request returns 404 error! With what it can be connected?

KimonoVIP avatar Mar 20 '19 19:03 KimonoVIP

@KimonoVIP I pushed some changes regarding long standing issues in #52 that sound similar to your issue. Can you please update your plugin to at least version 4.1.1 and let me know if the problem persists? Thanks!

scniro avatar Apr 23 '19 12:04 scniro

@scniro Updated to version 4.2.0 - it did not help. Anyway, the path to the background image after the assembly is distorted and does not work. So far I have been using this method (

.option::before { /* clean-css ignore:start / background: url("../img/check.svg") center no-repeat; / clean-css ignore:end */ }

KimonoVIP avatar Apr 24 '19 11:04 KimonoVIP

look at https://github.com/jakubpawlowicz/clean-css/issues/1100

mydansun avatar Apr 19 '20 11:04 mydansun