at main 502 B view raw
1import { validate } from "csstree-validator"; 2import "lume/types.ts"; 3import { log } from "lume/core/utils/log.ts"; 4 5// CSS Validation Plugin, by dish 6// version 1.0.0 7 8export default function () { 9 return (site: Lume.Site) => { 10 site.process([".css"], validateStylesheets); 11 12 function validateStylesheets(pages: Lume.Page[]) { 13 for (const page of pages) { 14 log.info(page.content as string); 15 log.error(validate(page.content as string, page.sourcePath)); 16 } 17 } 18 }; 19}