 				content.push result
 
 		content.push @customCSS
+
 		content = content.join '\n'
 
 		options =

WebAppHashing.calculateClientHash = (manifest, includeFilter, runtimeConfigOverride) ->
	css = RocketChat.theme.getCss()

	WebAppInternals.staticFiles['/__cordova/theme.css'] = WebAppInternals.staticFiles['/theme.css'] =
		cacheable: true
		sourceMapUrl: undefined
		type: 'css'
		content: css

	hash = crypto.createHash('sha1').update(css).digest('hex')

	themeManifestItem = _.find manifest, (item) -> return item.path is 'app/theme.css'
	if not themeManifestItem?
		themeManifestItem = {}
		manifest.push themeManifestItem

	themeManifestItem.path = 'app/theme.css'
	themeManifestItem.type = 'css'
	themeManifestItem.cacheable = true
	themeManifestItem.where = 'client'
	themeManifestItem.url = "/theme.css?#{hash}"
	themeManifestItem.size = css.length
	themeManifestItem.hash = hash

	calculateClientHash.call this, manifest, includeFilter, runtimeConfigOverride


		# Add option to use extended (minor) color palette
		RocketChat.settings.add 'theme-option-extended-colors', false, { group: 'Layout', type: 'boolean', public: false, i18nDescription: 'Use_minor_colors'}

		RocketChat.settings.onload 'css', Meteor.bindEnvironment (key, value, initialLoad) =>
			if not initialLoad
				Meteor.startup ->
					process.emit('message', {refresh: 'client'})

		@compileDelayed = _.debounce Meteor.bindEnvironment(@compile.bind(@)), 100

		Meteor.startup =>
			RocketChat.settings.onAfterInitialLoad =>

				RocketChat.settings.get '*', Meteor.bindEnvironment (key, value, initialLoad) =>
					if key is 'theme-custom-css'
						if value?.trim() isnt ''
							@customCSS = value
					else if /^theme-.+/.test(key) is true
						name = key.replace /^theme-[a-z]+-/, ''
						if @variables[name]?
							@variables[name].value = value
					else
						return

					@compileDelayed()

	compile: ->
		content = [
