# Default config for SVGO
#
# Usage:
#
#   for d in Papirus/16x16/* Papirus/22x22/* Papirus/24x24/*
#   do
#     svgo --config=_svgo.yml -f "$d"
#   done
#
# or
#
#   svgo --config=_svgo.yml -f Papirus/16x16/actions
#
# or
#
#   svgo --config=_svgo.yml -i FILE

full: true
multipass: true

plugins:

  # removes doctype declaration
  - removeDoctype

  # removes XML processing instructions
  - removeXMLProcInst

  # removes comments
  - removeComments

  # removes <metadata>
  - removeMetadata

  # removes editors namespaces, elements and attributes
  - removeEditorsNSData

  # removes unused IDs
  # - cleanupIDs:
  #     minify: false
  #     preserve: [ 'current-color-scheme' ]

  # removes elements in <defs> without id
  - removeUselessDefs

  # sorts element attributes (disabled by default)
  - sortAttrs:
      order:
        - id
        - fill
        - stroke
        - opacity
        - style
        - class
        - width
        - height
        - x
        - x1
        - x2
        - y
        - y1
        - y2
        - cx
        - cy
        - rx
        - ry
        - r
        - transform
        - marker
        - points
        - d

  # rounds numeric values to the fixed precision
  # removes default ‘px’ units
  # y="749.936002px" --> y="749.936"
  - cleanupNumericValues:
      floatPrecision: 3
      leadingZero: true
      defaultPx: true
      convertToPx: false

  # rounds list of values to the fixed precision
  # viewBox="0 0 16px 16px" --> viewBox="0 0 16 16"
  - cleanupListOfValues:
      floatPrecision: 2
      leadingZero: true
      defaultPx: true
      convertToPx: false

  # converts colors: rgb() to #rrggbb
  - convertColors:
      shorthex: false
      shortname: false

  # convert non-eccentric <ellipse> to <circle>
  - convertEllipseToCircle

  # removes unknown elements content and attributes
  # don't touch attrs with default values
  # - removeUnknownsAndDefaults:
  #     defaultAttrs: false

  # removes viewBox attr which coincides with a width/height box
  - removeViewBox

  # remove or cleanup enable-background attribute when possible
  - cleanupEnableBackground

  # removes hidden elements (zero sized, with absent attributes)
  - removeHiddenElems:
      opacity0: false

  # removes empty <text> elements
  - removeEmptyText

  # removes empty attributes
  - removeEmptyAttrs

  # removes empty container elements
  - removeEmptyContainers

  # removes unused namespaces declaration
  - removeUnusedNS

  # removes <title>
  - removeTitle

  # removes <desc>
  - removeDesc

  # cleanups attributes from newlines, trailing and repeating spaces
  - cleanupAttrs

# configure the indent (default 4 spaces) used by `--pretty` here:
#
# @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
#
js2svg:
  pretty: true
  indent: ' '
