How to alter index.less file based on config option toggle


I have a theme and I would like to alter my files included in my index.less based on whether someone checked a checkbox within the settings or not.

So far I’ve got

module.exports =
            type: 'object'
                    title: 'Toggle Dynamic UI Colour'
                    description: 'UI will change colours based on syntax chosen'
                    type: 'boolean'
                    default: false

    activate: (state) ->
        atom.themes.onDidChangeActiveThemes ->
            Config = require './config'

	toggleDinamicUI = (boolean) ->
		if boolean
			# add import to file
			# remove imports from file

	atom.config.onDidChange 'genesis-ui.dynamicUI.toggleDinamicUI', ->



Doing what you’re describing either isn’t possible or is a much, much harder way than it needs to be. See my post in a recent topic for more information.


Well my issue is that I can’t just simply add hard coded less selectors styles I need to alter variables based on config selection. So I must either somehow get vars from the less file and alter them or swap loaded files by asking user to reopen there editor.

Or I write to file…

but I figured it would be easier to just swap index.less files onload of atom. But I don’t know how.