Git Product home page Git Product logo

Comments (3)

andrewalexeich avatar andrewalexeich commented on August 14, 2024

@mars092 привет! Допустим, у тебя спрайт собрался из one.svg, two.svg и three.svg. Тебе надо вывести на страницу one.svg, значит:

<img src="img/sprites/sprite.svg#one">

from gulp-scss-starter.

mars092 avatar mars092 commented on August 14, 2024

@andreyalexeich Спасибо за ответ, но...
Было бы хорошо описать в документации про svg use.

К примеру мы добавили svg logo.svg и обратится к нему нужно в таком виде:

<svg>
  <use xlink:href="img/sprites/sprite.svg#logo"></use>
</svg>

Что бы поменять цвет svg нужно в css обратится к нему в таком виде:

svg use {
  fill: red;
}

Но что бы это заработало в svg нужно почистить некоторые параметры. К примеру в таком виде отдает svg figma:

<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M4.90918 4.04542L13.091 9.54088L4.90918 14.9545L4.90918 4.04542Z" fill="#1B1B1D"/>
</svg>

Нужно удалить эти кусочки fill="none" и fill="#1B1B1D". Должно получится вот так:

<svg width="18" height="19" viewBox="0 0 18 19" xmlns="http://www.w3.org/2000/svg">
  <path d="M4.90918 4.04542L13.091 9.54088L4.90918 14.9545L4.90918 4.04542Z" />
</svg>

from gulp-scss-starter.

andrewalexeich avatar andrewalexeich commented on August 14, 2024

Сделано

from gulp-scss-starter.

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.