Giter Club home page Giter Club logo

material-icons-php-svg's Introduction

Material Icons in PHP as SVG objects

Installation

composer require aciety/material-icons

Usage

<?php

use Aciety\Component\MaterialIcons\AbcIcon;

require __DIR__.'/vendor/autoload.php';

header('Content-Type: image/svg+xml');

$abcIcon = new AbcIcon();

echo $abcIcon->toXMLString(standalone: false);

// Will output to the browser:
// <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
//   <g>
//     <rect width="24" height="24" style="fill: none" />
//   </g>
//   <g>
//     <path d="M21,11h-1.5v-0.5h-2v3h2V13H21v1c0,0.55-0.45,1-1,1h-3c-0.55,0-1-0.45-1-1v-4c0-0.55,0.45-1,1-1h3c0.55,0,1,0.45,1,1V11z M8,10v5H6.5v-1.5h-2V15H3v-5c0-0.55,0.45-1,1-1h3C7.55,9,8,9.45,8,10z M6.5,10.5h-2V12h2V10.5z M13.5,12c0.55,0,1,0.45,1,1v1 c0,0.55-0.45,1-1,1h-4V9h4c0.55,0,1,0.45,1,1v1C14.5,11.55,14.05,12,13.5,12z M11,10.5v0.75h2V10.5H11z M13,12.75h-2v0.75h2V12.75z" />
//   </g>
// </svg>

Removing unneeded icons

Add this config to your composer.json: (it accepts globs, strings or regexes)

    "scripts": {
        "pre-autoload-dump": [
            "Aciety\\Component\\MaterialIcons\\Tool\\Composer::cleanup"
        ]
    },
    "extra": {
        "aciety/material-icons": {
            "exclude": [
                "AbcIcon.php",
                 "*TwoToneIcon*",
                 "/SharpIcon\.php$/"
            ]
        }
    }

material-icons-php-svg's People

Contributors

norkunas avatar

Stargazers

 avatar

Watchers

Aismantas Bulanavicius avatar  avatar

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.