madeleineostoja / rucksack

A little bag of CSS superpowers, built on PostCSS
https://www.rucksackcss.org
Other
1.85k stars 58 forks source link

Fallbacks fail with Stylus + Gulp #36

Open felipefialho opened 8 years ago

felipefialho commented 8 years ago

Hi guys, I love the Rucksack, it's a fantastic plugin and I write a post in last year about it.

Congratulations to the creators.

But, I never can make the fallbacks: true works.

Today, I use Grunt + Stylus and my task is:

var rucksack = require('rucksack-css');

function postcss() {
  return require('poststylus')([rucksack({
    fallbacks: true,
    autoprefixer: true
  })]);
}
stylus: {
      options: { 
        use: [ 
          postcss 
        ],
        compress: false,
        'include css': true,
        paths: [
          'node_modules/grunt-contrib-stylus/node_modules',
          'node_modules/jeet/stylus', 
          'node_modules/rupture'
        ]
      }, 
      dev: { 
      }
    }, 

The autoprefixer is working perfectly, but the fallbacks does't works, when I use this option, the CSS isn't generated in Stylus.

Somebody have this problem?

madeleineostoja commented 8 years ago

Hmm not sure what's going on here, as this is covered by unit tests. Will look into it more later today

felipefialho commented 8 years ago

Thanks @seaneking, I need this to use REM in old browsers.

I am waiting some resolution and for now I going to keep without fallback, haha

gosteev commented 7 years ago

had the same issue with gulp. fixed by writing function right inside use section:

.pipe(stylus({
  use: [
    require('poststylus')([rucksack({
      autoprefixer: true,
      fallbacks: true
    })])
  ]
}))
madeleineostoja commented 7 years ago

Looks like an issue with poststylus / stylus then - still not sure what would be causing it inside laggard (what fallbacks uses), but at least there's a workaround now. I'll leave this issue open for others, and if I get a chance at some point look into what's causing it more.