Information

Every dog needs a baby svg

Every dog needs a baby svg


We are searching data for your request:

Forums and discussions:
Manuals and reference books:
Data from registers:
Wait the end of the search in all databases.
Upon completion, a link will appear to access the found materials.

Every dog needs a baby svg icon

We started using svg and webpack + postcss to simplify our process of building UI (https://github.com/Nordada/Nordada.Projects/tree/master/client/components/nordada-svg-icons)

It was working perfectly until I decided to change the basecolor of the icon.

This is the original svg:

This is the result when I set background: blue (we use blue because is the mn color of our project):

When the color changed and now the original svg doesn't work anymore! What I need is the original blue color. I tried searching but didn't find anything related to the problem. I guess its because of some kind of opacity or shadow for the background but I am not sure what else could be the problem.

A:

Svg files is just a string, for this reason you can't change it's color using CSS, however, you can make a custom color for every icon.

You will need an object to keep track of your icons and a color class to apply it.

First we will create our icons:

const IconArray = {

circle: '<,svg width="25" height="25" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg">,<,circle cx="10" cy="10" r="9" stroke="black" stroke-width="1">,<,/circle>,<,/svg>,',

plus: '<,svg width="25" height="25" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg">,<,circle cx="10" cy="10" r="9" stroke="black" stroke-width="1" fill="red">,<,/circle>,<,/svg>,',

square: '<,svg width="25" height="25" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg">,<,circle cx="10" cy="10" r="9" stroke="black" stroke-width="1" fill="red">,<,/circle>,<,/svg>,'

},

const iconPath = document.getElementById("iconPath"),

const icon = document.getElementById("icon"),

function createIcon() {

let iconPath = document.createElement('i'),

iconPath.className = "icon",

iconPath.setAttribute("class", "icon--plus"),

let svg = document.createElement('svg'),

svg.className = "svg--icon",

svg.setAttribute("viewBox", "0 0 25 25"),

svg.setAttribute("width", "25"),

svg.setAttribute("height", "25"),

svg.setAttribute("viewBox", "0 0 25 25"),

let circle = document.createElement('circle'),

circle.setAttribute("cx", "10"),

circle.setAttribute("cy", "10"),

circle.setAttribute("r", "9"),

circle.setAttribute("stroke", "black"),

circle.setAttribute("stroke-width", "1"),

circle.setAttribute("fill", "red"),

svg.appendChild(circle),

iconPath.appendChild(svg),

icon.appendChild(iconPath),

}

// I need to apply this function to each of my objects

const style = document.querySelectorAll('.box-wrapper')

for (let i = 0, i <, style.length, i++) {

addIcon(style[i])

}

/*

This is the CSS I'm trying to apply to the object

*/

.box-wrapper {

position: relative,

margin: auto,

margin-top: 10px,

margin-bottom: 10px,

background-color: orange,

padding-top: 12px,

padding-bottom: 12px,

padding-left: 10px,

padding-right: 10px,

}

.box-wrapper:hover {

cursor: pointer,

}

.box-wrapper .box-title {

font-size: 24px,

color: black,

padding-top: 0px,

padding-bottom: 20px,

}

.box-wrapper .box-bottom {

font-size: 13px,

padding-top: 0px,

padding-bottom: 20px,

}

.box-wrapper .box-content {

font-size: 15px,

padding-top: 30px,

padding-bottom: 50px,

}

.box-wrapper .box-content h1 {

font-size: 24px,

padding-top: 50px,

color: black,

text-align: center,

}

<,script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">,<,/script>,

<,div class="box-wrapper">,

<,div class="box-title">,

<,h2>,Title<,/h2>,

<,/div>,

<,div class="box-bottom">,

<,h2>,Title<,/h2>,

<,/div>,

<,div class="box-content">,

<,h1>,Text<,/h1>,

<,/div>,

<,/div>,

A:

If you are using Bootstrap. You should not be using padding to add space between your elements, but instead add some margin to your rows. So if you have 2 columns with a 15px gap you add margin:0px 0px 15px 15px on your columns

<,div class="contner">,

<,div class="row">,

<,div class="col-xs-12 col-sm-6">,

<,div class="box-wrapper">,

<,div class="box-title">,

<,h2>,Title<,/h2>,

<,/div>,

<,div class="box-bottom">,

<,h2>,Title<,/h2>,


Watch the video: Every Baby Needs A Da-Da Daddy (May 2022).


Comments:

  1. Shak

    Gonivo

  2. Derward

    Bravo, your sentence at hand

  3. Manus

    I am very sorry that I cannot help you with anything. I hope they will help you here.



Write a message

Video, Sitemap-Video, Sitemap-Videos