Coder Social home page Coder Social logo

Comments (6)

passy avatar passy commented on May 18, 2024

I remember having a image_url helper back in the compass days. Is there something similar we could do in vanilla sass?

from material-design-lite.

sindresorhus avatar sindresorhus commented on May 18, 2024

https://github.com/postcss/postcss-url

from material-design-lite.

yantakus avatar yantakus commented on May 18, 2024

I would like to say, than not everyone is using gulp. I'm using webpack with url loader and I have to manually rewrite all the urls to url(mdl/images/tick-mask.svg) for it to work properly. So maybe we can use a variable here to concatenate with image name. For example:

$img-path: mdl/images/; // _variables.scss


mask: url(#{$img-path}tick-mask.svg); //_checkbox.scss

Or even create a mixin like this:

mask: @include img-url(tick-mask.svg);

from material-design-lite.

RanzQ avatar RanzQ commented on May 18, 2024

I'm using webpack too and having problems with this... The latest version has ?embed suffix (for gulp-css-inline-images) but I don't know how to setup a webpack loader to discard the suffix and look for the svg file.

I haven't used gulp and don't know if there's a better option but a size based inlining tool would be better imo.

Maybe this? https://github.com/zckrs/gulp-css-base64

from material-design-lite.

yantakus avatar yantakus commented on May 18, 2024

@RanzQ I removed ?embed suffix and use url-loader for embedding SVGs:

    loaders: [
      {
        test: /\.svg$/,
        loader: 'url-loader?limit=100000',
      },
    ],

from material-design-lite.

RanzQ avatar RanzQ commented on May 18, 2024

@web2style yeah that's what I ended up doing too but for easier updates I like keeping the source in node_modules/ and only define custom variables and decide which components to import. Now I have to check on every update that my modified files are in sync. :)

Another option would be to fork this repo and install it.

from material-design-lite.

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.