mrnocreativity / postcss-critical-split

A PostCSS plugin that takes existing CSS files and splits out the annotated critical styles into a seperate file.
MIT License
89 stars 6 forks source link

first line removed #6

Closed Detzler closed 5 years ago

Detzler commented 7 years ago

Hi,

I got a case where the first line in a css block is removed each time the split operation runs.

original css:

/* critical:start */
.logobar {
  width: 80px;
  height: 100%;
  z-index: 999;
  position: fixed; }

/* critical:end */

css after split, "width" is missing:

.logobar {
    height: 100%;
    z-index: 999;
    position: fixed;
}

my grunt config is:

'split-rest': {
    src: ['css/style-sass.css'],
    dest: 'css/style-rest.css',
    options: {
        processors: [
            criticalSplit({
                output: 'rest'
            })
        ]
    }
},

Does anybody have an idea why the first line got removed?

mrnocreativity commented 6 years ago

Hey @Detzler, i just added a new test to the repo. Run it with npm test weird-first-line-bug.

It looks like the plugin is working as expected to me. Could you let me know if you managed to fix this?

mrnocreativity commented 5 years ago

I'm closing this issue as it's not been able to be reproduced and there was no new feedback.