Coder Social home page Coder Social logo

Major prefixing problems about compass-mixins HOT 2 CLOSED

igosuki avatar igosuki commented on July 20, 2024
Major prefixing problems

from compass-mixins.

Comments (2)

OnkelTem avatar OnkelTem commented on July 20, 2024

While this issue has no evident solutions, as the whole vendor prefixing stuff is missed in compass-mixins, I want to provide one workaround.

Suppose we have a code like this:

@include background(url('/build/images/i-plus.png') no-repeat center center, red);

And currently it generates this crap:

background: -owg-url("/build/images/i-plus.png") no-repeat center center, red;
background: -webkit-url("/build/images/i-plus.png") no-repeat center center, red;
background: -moz-url("/build/images/i-plus.png") no-repeat center center, red;
background: -o-url("/build/images/i-plus.png") no-repeat center center, red;
-pie-background: -pie-url("/build/images/i-plus.png") no-repeat center center, red;
background: url("/build/images/i-plus.png") no-repeat center center, red;

To get it produce something sensible, we need to remove all space-separated lists and provide removed properties later, for example:

@include background(url('image.png'), red);
background-repeat: no-repeat;
background-position: center center;

Now we get:

background: url("/build/images/i-plus.png"), red;
background: url("/build/images/i-plus.png"), red;
background: url("/build/images/i-plus.png"), red;
background: url("/build/images/i-plus.png"), red;
-pie-background: url("/build/images/i-plus.png"), red;
background: url("/build/images/i-plus.png"), red;
background-repeat: no-repeat;
background-position: center center;

which is of course weird (as it repeats the same stuff many times and has -pie- garbage) but at least it works.

from compass-mixins.

OnkelTem avatar OnkelTem commented on July 20, 2024

Ok, forget about it. If you really want prefixes to start working - don't use background and similar mixins just to get browser support. Instead use regular CSS stuff but pipe it through the beautiful https://github.com/postcss/autoprefixer

from compass-mixins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.