4chan-x/src/Miscellaneous/CustomCSS.coffee
ccd0 ea3c4d9bc6 Custom CSS should always be added after main CSS.
Also fix issue with "undefined" IDs.
2014-10-25 19:32:16 -07:00

16 lines
344 B
CoffeeScript
Executable File

CustomCSS =
init: ->
return unless Conf['Custom CSS']
@addStyle()
addStyle: ->
$.asap (-> $.id 'fourchanx-css'), =>
@style = $.addStyle Conf['usercss'], 'custom-css'
rmStyle: ->
if @style
$.rm @style
delete @style
update: ->
unless @style
@addStyle()
@style.textContent = Conf['usercss']