ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

SVG-Snippets

by jorgeatgu ST2/ST3

:beginner: A set of custom SVG snippets for Sublime Text 2/3

Labels snippets

Details

Installs

  • Total 6K
  • Win 4K
  • OS X 2K
  • Linux 791
May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8
Windows 1 6 3 4 2 3 2 7 0 0 1 2 3 4 3 2 2 2 3 7 4 4 2 5 2 1 4 5 4 2 3 1 6 2 2 6 2 3 1 2 7 5 2 5 4 3
OS X 0 1 2 1 0 1 4 1 2 1 1 2 1 2 4 1 0 0 0 2 2 2 1 0 1 2 0 0 4 5 1 1 1 4 0 1 1 2 2 1 2 5 3 3 2 1
Linux 0 1 0 1 0 0 1 1 1 0 1 1 0 0 0 2 0 1 2 0 0 2 0 0 0 0 2 1 0 1 2 1 2 0 0 0 1 1 0 0 1 2 3 3 1 1

Readme

Source
raw.​githubusercontent.​com

SVG-Snippets

Type the snippet shortcode and then press Tab to complete the snippet.

The snippets are listed below in alphabetical order. The '$1' indicates the position of the caret/s. Some snippets have been set up so that pressing Tab jumps the caret/s to the next predefined spot. It's a little hard to explain, but any snippet that has a $1/$2/$3/etc. uses this technique.

Package Control

CodePen

Video Vimeo

Circle

Write circle

/* after */

<circle r="$1" cx="$2" cy="$3" fill="$4" stroke="$5" stroke-width="$6"/>

Write circle3

/* after */

<circle r="$1" cx="$2" cy="$3" fill="$4" stroke="$5" stroke-width="$6"/>
<circle r="$1" cx="$2" cy="$3" fill="$4" stroke="$5" stroke-width="$6"/>
<circle r="$1" cx="$2" cy="$3" fill="$4" stroke="$5" stroke-width="$6"/>

Write circleu

/* after */

<defs>
    <circle id="$1" r="$2" cx="$3" cy="$4" fill="$5" stroke="$6" stroke-width="$7"/>
</defs>

<use xlink:href="#$8"/>
<use xlink:href="#$8" x="$9" y="$10"/>

Clippath

Write clippath

/* after */

<defs>
    <clipPath id="$1">
        $2
    </clipPath>
</defs>

Defs + use

Write defsuse

/* after */

<defs>

</defs>

<use xlink:href="#$1"/>
<use xlink:href="#$1" x="$2" y="$3"/>

Ellipse

Write ellipse

/* after */

<ellipse rx="$1" ry="$2" cx="$3" cy="$4" fill="$5" stroke="$6" stroke-width="$7"/>

Write ellipse3

/* after */

<ellipse rx="$1" ry="$2" cx="$3" cy="$4" fill="$5" stroke="$6" stroke-width="$7"/>
<ellipse rx="$1" ry="$2" cx="$3" cy="$4" fill="$5" stroke="$6" stroke-width="$7"/>
<ellipse rx="$1" ry="$2" cx="$3" cy="$4" fill="$5" stroke="$6" stroke-width="$7"/>

Write ellipseu

/* after */

<defs>
    <ellipse id="$1" rx="$2" ry="$3" cx="$4" cy="$5" fill="$6" stroke="$7" stroke-width="$8"/>
</defs>

<use xlink:href="#$9" />
<use xlink:href="#$9" x="$10" y="$11"/>

Group

Write group

/* after */

<g id="$1">

    $2

</g>

Line

Write line

/* after */

<line x1="$1" y1="$2" x2="$3" y2="$4" stroke="$5" stroke-width="$6"/>

Write lineu

/* after */

<defs>
    <line x1="$1" y1="$2" x2="$3" y2="$4" stroke="$5" stroke-width="$6"/>
</defs>

<use xlink:href="#$7" />
<use xlink:href="#$7" x="$8" y="$9"/>

Lineargradient

Write lineargradient

/* after */

<linearGradient id="$1" gradientUnits="objectBoundingBox">
    <stop offset="$2" stop-color="$3"/>
    <stop offset="$4" stop-color="$5"/>
</linearGradient>

Matrix

Write matrix

/* after */

transform="matrix($1 $2 $3 $4 $5 $6)"

Path

Write path

/* after */

<path d="$1" stroke-width="$2" stroke="$3" fill="$4"/>

Pattern

Write pattern

/* after */

<defs>
    <pattern id="$1" width="$2" height="$3" patternUnits="userSpaceOnUse">
        $4
    </pattern>
</defs>

Polygon

Write polygon

/* after */

<polygon points="$1" fill="$2" stroke="$3" stroke-width="$4"/>

Write polygon3

/* after */

<polygon points="$1" fill="$2" stroke="$3" stroke-width="$4"/>
<polygon points="$1" fill="$2" stroke="$3" stroke-width="$4"/>
<polygon points="$1" fill="$2" stroke="$3" stroke-width="$4"/>

Write polygonu

/* after */

<defs>
    <polygon points="$1" fill="$2" stroke="$3" stroke-width="$4"/>
</defs>

<use xlink:href="#$7" />
<use xlink:href="#$7" x="$8" y="$9"/>

Polyline

Write polyline

/* after */

<polyline points="$1" fill="$2" stroke="$3" stroke-width="$4"/>

Write polyline3

/* after */

<polyline points="$1" fill="$2" stroke="$3" stroke-width="$4"/>
<polyline points="$1" fill="$2" stroke="$3" stroke-width="$4"/>
<polyline points="$1" fill="$2" stroke="$3" stroke-width="$4"/>

Write polylineu

/* after */

<defs>
    <polyline id="$1" points="$2" fill="$3" stroke="$4" stroke-width="$5"/>
</defs>

<use xlink:href="#$6"/>
<use xlink:href="#$6" x="$7" y="$8"/>

Radialgradient

Write radialgradient

/* after */

<radialGradient id="$1" gradientUnits="objectBoundingBox">
    <stop offset="$2" stop-color="$3"/>
    <stop offset="$4" stop-color="$5"/>
</radialGradient>

Rect

Write rect

/* after */

<rect x="$1" y="$2" width="$3" height="$4" fill="$5" stroke="$6" stroke-width="$7"/>

Rect3

Write rect3

/* after */

<rect x="$1" y="$2" width="$3" height="$4" fill="$5" stroke="$6" stroke-width="$7"/>
<rect x="$1" y="$2" width="$3" height="$4" fill="$5" stroke="$6" stroke-width="$7"/>
<rect x="$1" y="$2" width="$3" height="$4" fill="$5" stroke="$6" stroke-width="$7"/>

Rectu

Write rectu

/* after */

<defs>
    <rect id="$1" x="$2" y="$3" width="$4" height="$5" fill="$6" stroke="$7" stroke-width="$8"/>
</defs>

<use xlink:href="#$9"/>
<use xlink:href="#$9" x="$10" y="$11"/>

Rotate

Write rotate

/* after */

transform="rotate($1)"

Scalable

Write scalable

/* after */

<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"
            viewBox="$1" width="$2" height="$3" aria-labelledby="title desc">

                <title id="title">$4</title>
                <desc id="desc">$5</desc>

</svg>

Scalableu

Write scalableu

/* after */

<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"
            viewBox="$1" width="$2" height="$3" aria-labelledby="title desc">

                <title id="title">$4</title>
                <desc id="desc">$5</desc>

                <defs>



                </defs>


                <use xlink:href="#" x="" y=""/>

</svg>

SkewX

Write skewx

/* after */

transform="skewX($1)"

SkewY

Write skewy

/* after */

transform="skewY($1)"

Symbol

Write symbol

/* after */

<symbol id="$1">

</symbol>
<use xlink:href="#$1"/>
<use xlink:href="#$1" x="$2" y="$3"/>

Text

Write text

/* after */

<text x="$1" y="$2" fill="$3">$4</text>

Translate

Write translate

/* after */

transform="translate($1)"

Tspan

Write tspan

/* after */

<tspan fill="$1" x="$2" y="$3">$4</tspan>

Use

Write use

/* after */

<use xlink:href="#$1" x="$2" y="$3"/>

Use3

Write use3

/* after */

<use xlink:href="#$1"/>
<use xlink:href="#$1" x="$2" y="$3"/>
<use xlink:href="#$1" x="$4" y="$5"/>

Scalable with Inverted Y-Axis

Write scalablei

/* after */

<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"
    viewBox="$1 $2 $3 $4" width="$5" height="$6" aria-labelledby="title desc">
        <title id="title">$7</title>
        <desc id="desc">$8</desc>
        <g transform="translate(0,$4) scale(1,-1)">
            ${9:}
        </g>

</svg>