Best Products
Launches
Launch archive
Most-loved launches by the community
Launch Guide
Checklists and pro tips for launching
News
Newsletter
The best of Product Hunt, every day
Stories
Tech news, interviews, and tips from makers
Changelog
New Product Hunt features and releases
Forums
Forums
Ask questions, find support, and connect
Kitty Points Leaderboard
The highest scoring community members
Streaks
The most active community members
Events
Meet others online and in-person
Advertise
Subscribe
Sign in
Clear text
recent
p/self-promotion
by
Andrew Gabaraev
•
3mo ago
I built a Vite plugin that saves CSS changes directly to your source files
... stores in raws and reproduces on toString(). root.walkRules((rule) => { if (rule.selector !== targetSelector) return; rule.walkDecls(prop, (decl) => { decl.value = newValue; }); }); writeFileSync(filePath, root.toString()); // formatting preserved For SCSS, postcss-scss is used it understands SCSS syntax including $variables, nesting, and
mixins
that standard PostCSS doesn't parse. HMR: from setTimeout to confirmation The first version looked like this: after sending the patch over WebSocket, wait 400ms, then re-read the CSSOM. send({ fileUrl, selector, prop, value }); setTimeout(() => { editor.refresh(); }, 400); // fixed ...
0
1
Subscribe
Sign in