Generate CSS for KSS through ResourceLoader
authorMatthew Flaschen <mflaschen@wikimedia.org>
Wed, 22 Jan 2014 04:27:42 +0000 (20:27 -0800)
committerMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 23 Jan 2014 00:35:00 +0000 (16:35 -0800)
This ensures the LESS is processed the same, so the behavior and output
exactly match.

Change-Id: I9bba8f2c328c9f9b9f7763cd335e280e973d03d6

resources/Makefile

index 4de5c2f..0d9608f 100644 (file)
@@ -1,9 +1,17 @@
+MEDIAWIKI_LOAD_URL ?= http://localhost/w/load.php
+
 kss: nodecheck
 # FIXME: Use more up-to-date Ruby version
-       @node_modules/.bin/kss-node mediawiki.ui mediawiki.ui/docs -l mediawiki.ui/vector.less -t styleguide-template
+
+# Generates CSS of mediawiki.ui and mediawiki.ui.button using ResourceLoader, then applies it to the
+# KSS style guide
+       $(eval KSS_RL_TMP := $(shell mktemp /tmp/tmp.XXXXXXXXXX))
+       @curl -sG "${MEDIAWIKI_LOAD_URL}?modules=mediawiki.ui|mediawiki.ui.button&only=styles" > $(KSS_RL_TMP)
+       @node_modules/.bin/kss-node mediawiki.ui mediawiki.ui/docs --css $(KSS_RL_TMP) -t styleguide-template
        @echo Opening the generated style guide...
        @command -v xdg-open >/dev/null 2>&1 || { open ${PWD}/mediawiki.ui/docs/index.html; exit 1; }
        @xdg-open ${PWD}/mediawiki.ui/docs/index.html
+       @rm $(KSS_RL_TMP)
 
 nodecheck:
        @scripts/nodecheck.sh