Skip to content

Instantly share code, notes, and snippets.

@davemo
Created December 30, 2009 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davemo/266359 to your computer and use it in GitHub Desktop.
Save davemo/266359 to your computer and use it in GitHub Desktop.
=horizontal-form(!width)
width = !width
input
float: left
&[type="text"],&[type="select"]
width: 70%
&[type="submit"]
float: right
label
+clearfix
span
padding: 1px
display: block
float: left
width: 25%
=vertical-form(!width)
width = !width
& label, input
display: block
// usage
form#addlinks
+horizontal-form(300px)
// html
<form id="addlinks">
<fieldset>
<legend>Add Links</legend>
<label>
<span>Link</span>
<input type="text" id="link" />
</label>
<label>
<span>Name</span>
<input type="text" id="name" />
</label>
<input type="submit" value="Add Link" id="addlink" />
</fieldset>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment