const Path = require('path')
const fs = require('fs')

let target = process.argv[2]

let path = Path.isAbsolute(target) ? target : Path.join(process.cwd(), target)

let out = fs.readFileSync(path).toString('utf-8').replaceAll(
  /  <\w+ .*? id='([a-z_]+)' fill='#([A-Za-z0-9]+)'><\/\w+>/g,
  '@$1: #$2;'
)
.split('\n').filter(line => line.startsWith('@')).join('\n')

console.log(out)