Update styles.less upon package installation


#1

Hi all,

I have made a language highlight package which contains embedded PERL.
In order to give it a different background in Atom, several lines of code are added to styles.less in order to make this happen. I would like to automatically add these lines to styles.less upon installation of the package.
Any ideas on how to achieve this?


#2

You put style information in a styles/ directory inside your package. All CSS and Less files in that directory are loaded when your package is activated.


#3

Works perfectly! Thanks a lot.

What I also would like to add is to be able to change the background color parameters in the settings menu of my package. How would I do that?


#4

You would need to use JavaScript to register config options and then inject the appropriate style rules with the color chosen in the configuration.