SVG icon theming

Developer
Size
2,268 Kb
Views
2,024

How do I make an svg icon theming?

Trying to recreate Adobe Photoshop's icons in SVG and alter the colors using CSS.. What is a svg icon theming? How do you make a svg icon theming? This script and codes were developed by Jon Graft on 30 January 2023, Monday.

SVG icon theming Previews

SVG icon theming - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SVG icon theming</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Open+Sans'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div style="height: 100%; width: 100%;">	<div class="col1">	<h1>Light Theme</h1>	<hr />	<!-- CROP -->	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32">	<defs>	<linearGradient id="dark" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2">	<stop stop-color="#A6AFB7"/>	<stop offset="1" stop-color="#DCE0E3"/>	</linearGradient>	<linearGradient id="light" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2">	<stop stop-color="#2A2F34"/>	<stop offset="1" stop-color="#4D575F"/>	</linearGradient>	</defs>	<path class="icon" d="M11,8V2H7v6H1v4h6v14h14v6h4v-6h6v-4h-6V8H11z M21,12v10H11V12H21z"/>	<g class="shadow">	<path d="m11 6h14v2h-14z"/>	<path d="m11 20h10v2h-10z"/>	<path d="m25 20h6v2h-6z"/>	<path d="m7 0h4v2h-4z"/>	<path d="m1 6h6v2h-6z"/>	</g>	<g class="shine">	<path d="m1 10h6v2h-6z"/>	<path d="m7 24h14v2h-14z"/>	<path d="m11 10h10v2h-10z"/>	<path d="m25 24h6v2h-6z"/>	<path d="m21 30h4v2h-4z"/>	</g>	</svg>	<br /><br />	</div>	<div class="col2">	<h1>Dark Theme</h1>	<hr />	<!-- CROP -->	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32">	<defs>	<linearGradient id="dark" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2">	<stop stop-color="#A6AFB7"/>	<stop offset="1" stop-color="#DCE0E3"/>	</linearGradient>	<linearGradient id="light" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2">	<stop stop-color="#2A2F34"/>	<stop offset="1" stop-color="#4D575F"/>	</linearGradient>	</defs>	<path class="icon" d="M11,8V2H7v6H1v4h6v14h14v6h4v-6h6v-4h-6V8H11z M21,12v10H11V12H21z"/>	<g class="shadow">	<path d="m11 6h14v2h-14z"/>	<path d="m11 20h10v2h-10z"/>	<path d="m25 20h6v2h-6z"/>	<path d="m7 0h4v2h-4z"/>	<path d="m1 6h6v2h-6z"/>	</g>	<g class="shine">	<path d="m1 10h6v2h-6z"/>	<path d="m7 24h14v2h-14z"/>	<path d="m11 10h10v2h-10z"/>	<path d="m25 24h6v2h-6z"/>	<path d="m21 30h4v2h-4z"/>	</g>	</svg>	<br /><br />	</div>
</div>
</body>
</html>

SVG icon theming - Script Codes CSS Codes

/* UNIVERSAL */
body {font-family: 'Open Sans', sans-serif;}
.col1, .col2 { width: 48%; height: 100%; padding: 0 10px;
}
.col1 { background-color: #A6AFB7; float: left;
}
.col2 { background-color: #4D575F; color: #FFFFFF; float: right;
}
svg { width: 32px; height: 32px;
}
/* Light Theme */
.col1 .icon{ fill: url(#light);
}
.col1 .shadow { fill: #EEF0F3 ; opacity: .45;
}
.col1 .shine { fill: #2A2F34; opacity: .5;
}
/* Dark Theme */
.col2 .icon{ fill: url(#dark);
}
.col2 .shadow { fill: #000; opacity: .35;
}
.col2 .shine { fill: #EEF0F3; opacity: .5;
}
SVG icon theming - Script Codes
SVG icon theming - Script Codes
Home Page Home
Developer Jon Graft
Username FlyersPh9
Uploaded January 30, 2023
Rating 3
Size 2,268 Kb
Views 2,024
Do you need developer help for SVG icon theming?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jon Graft (FlyersPh9) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!