Using CSS files from RStudio for HTML page

I have been using RStudio for some HTML dev. When I include the CSS in a <style> tag in the <head> of the document everything works fine. Moving the CSS into a .css file though produces errors. The error is specifically when using variables in CSS.

:root {
  --dark-blue: #466683;
  --grey: #c0c9cc;
  --green: #55ebbc;
  --yellow: #f6e995;

Each -- line gets the error Expected RBRACE at line x, col x. I don't know a ton about CSS and this is my first time using RStudio as an HTML IDE.

Any help would be appreciated.