mnussbaumer / cssex

An Elixir based and opinionated way to write CSS
MIT License
20 stars 0 forks source link

Implicit ordering of selectors & file events #21

Closed mnussbaumer closed 3 years ago

mnussbaumer commented 3 years ago

Restricted the file system events that trigger a recompilation so that only when the file is closed and modified does it trigger, only tested in linux with inotify tools but produces much less triggers. Another option is some delayed buffering to trigger.

Now instead of writing the final file directly when parsing, it outputs to a temp file and once finished just copies it over and deletes the temp. This was also the cause of several events being fired as it was writing things in loops and it would trigger inotify.

Added implicit ordering of the selectors, since CSS defines itself the selector priority by their position on the stylesheet and browsers have to respect that.