Skip to content

Instantly share code, notes, and snippets.

@rezoner
Last active February 3, 2016 14:01
Show Gist options
  • Save rezoner/d01d0adcc2f2a7f4caf4 to your computer and use it in GitHub Desktop.
Save rezoner/d01d0adcc2f2a7f4caf4 to your computer and use it in GitHub Desktop.
/*
What I would like to have is a way to build an element out of components.
Components can duplicate and order can be easily set.
*/
".content button": [
["image", "button.png", 0, 0],
["sprite", "flames", "center", "center"],
["text", "HEAVY LASER", "center", "top"],
["text", "80 credits", "center", "bottom"],
["image", "glass-overlay.png", 0, 0],
["borderImage", "border-on-top-of-that.png", 0, 0]
]
/*
The downside of this approach is that cascading will not work.
The downside of DOM/CSS way is that I would have to create 6 additional elements and stack them on top of each other.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment