sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

PostCSS logical properties output is missed out #552

Open lukaskoeller opened 1 year ago

lukaskoeller commented 1 year ago

Describe the bug If I use css logical properties (as part of the postcss-preset-env), something like padding-inline is correctly transformed. Though, when I use padding-inline-start, the plugin generates new selectors (e.g. [dir="ltr"] div { padding-left: 1px }) but it is not part of the output.

Logs n/a

To Reproduce Use the postcss-preset-env plugin for postcss and use css logical properties that contain start or end in their property.

Expected behavior The output of the postcss logical plugin and postcss dir plugin actually appears in the final css generated by svelte.

/* Input */
section {
  padding-inline-start: 30px;
}

/* Output */
[dir="ltr"] section.s-f0oQgdSLZrX7 {

Information about your project:

lukaskoeller commented 1 year ago

Workaround

Setting the dir via options make it work

postcss.config.cjs

const config = {
  plugins: [
    autoprefixer,
    postcssPresetEnv({
      stage: 1,
      features: {
        'logical-properties-and-values': {
          dir: 'ltr'
        }
      }
    })
  ]
};