23 lines
429 B
Python
23 lines
429 B
Python
from pathlib import Path
|
|
from string import Template
|
|
|
|
LIST_ITEM = Template(
|
|
""".$name {
|
|
mask-image: url(./svg/$name.svg);
|
|
}
|
|
"""
|
|
)
|
|
|
|
|
|
def generate():
|
|
work_dir = Path(__file__).parent
|
|
data = ""
|
|
for item in (work_dir / "svg").glob("*.svg"):
|
|
data += LIST_ITEM.substitute({"name": item.stem})
|
|
target = work_dir / "classes-list.scss"
|
|
target.write_text(data)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
generate()
|