Permalink
Browse files

Changed to mixin, added some stylus middleware and build commands

  • Loading branch information...
1 parent 2e72741 commit 7a99617ad97da82a1eb0e09f43bc8f9866b24fd7 @3rd-Eden committed Mar 26, 2012
Showing with 361 additions and 124 deletions.
  1. +14 −0 Makefile
  2. +4 −0 build.styl
  3. +163 −0 css/debug.css
  4. +23 −0 css/debug.min.css
  5. +1 −0 index.styl
  6. +31 −0 styl/debug.js
  7. +125 −124 styl/debug.styl
View
@@ -0,0 +1,14 @@
+RELEASE = ./css/debug.css
+RELEASE_MIN = ./css/debug.min.css
+BUILD_STYL = ./build.styl
+STYLUS_PROCESSOR ?= `which stylus`
+
+build:
+ @@if test ! -z ${STYLUS_PROCESSOR}; then \
+ stylus < ${BUILD_STYL} > ${RELEASE}; \
+ stylus --compress < ${BUILD_STYL} > ${RELEASE_MIN}; \
+ echo "done"; \
+ else \
+ echo "You must have the stylus compiler installed in order to build."; \
+ echo "You can install it by running: npm install stylus -g"; \
+ fi
View
@@ -0,0 +1,4 @@
+@import "styl/debug"
+
+html.debug
+ debug()
View
@@ -0,0 +1,163 @@
+html.debug [style]:not([scoped]) {
+ outline: 1px solid #ffa500;
+}
+html.debug [style]:not([scoped]):after {
+ content: "Don't use inline styles, replace it with external CSS definitions";
+}
+html.debug a[href*="javascript"] {
+ outline: 1px solid #f00;
+}
+html.debug a[href*="javascript"]:after {
+ content: "Don't use inline javascript, replace it with external JS files.";
+}
+html.debug a:not([href]):not([name]),
+html.debug a[href=""]:not([name]) {
+ outline: 1px solid #f00;
+}
+html.debug a:not([href]):not([name]):after,
+html.debug a[href=""]:not([name]):after {
+ content: "Missing or empty href attribute.";
+}
+html.debug img:not([alt]),
+html.debug img[alt=""] {
+ outline: 1px solid #f00;
+}
+html.debug img:not([alt]):after,
+html.debug img[alt=""]:after {
+ content: "Missing alt attribute.";
+}
+html.debug img:not([src]),
+html.debug img[src=""],
+html.debug video:not([src]),
+html.debug video[src=""],
+html.debug audio:not([src]),
+html.debug audio[src=""] {
+ outline: 1px solid #f00;
+}
+html.debug img:not([src]):after,
+html.debug img[src=""]:after,
+html.debug video:not([src]):after,
+html.debug video[src=""]:after,
+html.debug audio:not([src]):after,
+html.debug audio[src=""]:after {
+ content: "Missing src attribute.";
+}
+html.debug iframe {
+ outline: 1px solid #ffa500;
+}
+html.debug iframe:after {
+ content: "The use of iframes increases the loading times of your page.";
+}
+html.debug embed,
+html.debug object {
+ outline: 1px solid #ffa500;
+}
+html.debug embed:after,
+html.debug object:after {
+ content: "Use native HTML5 implementions instead of plugins.";
+}
+html.debug acronym,
+html.debug applet,
+html.debug basefont,
+html.debug big,
+html.debug center,
+html.debug dir,
+html.debug font,
+html.debug frame,
+html.debug frameset,
+html.debug isindex,
+html.debug layer,
+html.debug marquee,
+html.debug menu,
+html.debug nobr,
+html.debug noembed,
+html.debug noframes,
+html.debug nolayer,
+html.debug plaintext,
+html.debug spacer,
+html.debug strike,
+html.debug u,
+html.debug xml,
+html.debug xmp {
+ outline: 1px solid #f00;
+}
+html.debug acronym:after,
+html.debug applet:after,
+html.debug basefont:after,
+html.debug big:after,
+html.debug center:after,
+html.debug dir:after,
+html.debug font:after,
+html.debug frame:after,
+html.debug frameset:after,
+html.debug isindex:after,
+html.debug layer:after,
+html.debug marquee:after,
+html.debug menu:after,
+html.debug nobr:after,
+html.debug noembed:after,
+html.debug noframes:after,
+html.debug nolayer:after,
+html.debug plaintext:after,
+html.debug spacer:after,
+html.debug strike:after,
+html.debug u:after,
+html.debug xml:after,
+html.debug xmp:after {
+ content: "These elements have been depricated from the HTML specification.";
+}
+html.debug br[clear] {
+ outline: 1px solid #f00;
+}
+html.debug br[clear]:after {
+ content: "Don't use the clear attribute on <br> tags.";
+}
+html.debug [link],
+html.debug [vlink],
+html.debug [alink],
+html.debug [background],
+html.debug [bgcolor] {
+ outline: 1px solid #f00;
+}
+html.debug [link]:after,
+html.debug [vlink]:after,
+html.debug [alink]:after,
+html.debug [background]:after,
+html.debug [bgcolor]:after {
+ content: "Styling should be done with CSS, not using CSS attributes.";
+}
+html.debug [onmouseover],
+html.debug [onmouseout],
+html.debug [onmousedown],
+html.debug [onmouseup],
+html.debug [onclick],
+html.debug [ondblclick],
+html.debug [onmousemove],
+html.debug [onload],
+html.debug [onerror],
+html.debug [onbeforeunload],
+html.debug [onfocus],
+html.debug [onblur],
+html.debug [ontouchstart],
+html.debug [ontouchend],
+html.debug [ontouchmove] {
+ outline: 1px solid #f00;
+}
+html.debug [onmouseover]:after,
+html.debug [onmouseout]:after,
+html.debug [onmousedown]:after,
+html.debug [onmouseup]:after,
+html.debug [onclick]:after,
+html.debug [ondblclick]:after,
+html.debug [onmousemove]:after,
+html.debug [onload]:after,
+html.debug [onerror]:after,
+html.debug [onbeforeunload]:after,
+html.debug [onfocus]:after,
+html.debug [onblur]:after,
+html.debug [ontouchstart]:after,
+html.debug [ontouchend]:after,
+html.debug [ontouchmove]:after {
+ content: "Use proper event listeners instead of event attributes.";
+}
+
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1 @@
+@import 'styl/'
View
@@ -0,0 +1,31 @@
+function plugin () {
+ "use strict";
+
+ return function middleware (style) {
+ style.include(plugin.path);
+ };
+}
+
+/**
+ * Version number
+ *
+ * @type {String}
+ * @api private
+ */
+
+plugin.version = '0.0.1';
+
+/**
+ * Stylus path
+ *
+ * @type {String}
+ * @api private
+ */
+
+plugin.path = __dirname;
+
+/**
+ * Expose the middleware
+ */
+
+module.exports = plugin;
Oops, something went wrong.

0 comments on commit 7a99617

Please sign in to comment.