Skip to content

Commit

Permalink
added form, list, and table styling; moved form styling from layout.c…
Browse files Browse the repository at this point in the history
…ss to new form.css
  • Loading branch information
jamesarosen committed Jun 23, 2008
1 parent c56ea1e commit dc360cf
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 15 deletions.
3 changes: 3 additions & 0 deletions app/views/layouts/default.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<%= stylesheet_link_tag 'layout', :media => 'all' %>
<%= stylesheet_link_tag 'navbar', :media => 'screen' %>
<%= stylesheet_link_tag 'sidebar', :media => 'screen' %>
<%= stylesheet_link_tag 'form', :media => 'screen' %>
<%= stylesheet_link_tag 'list', :media => 'screen' %>
<%= stylesheet_link_tag 'table', :media => 'screen' %>
<%= stylesheet_link_tag 'color', :media => 'screen' %>
<%= stylesheet_link_tag 'browser', :media => 'screen' %>
<%= stylesheet_link_tag('debug', :media => 'all') if development? && false %>
Expand Down
147 changes: 147 additions & 0 deletions public/stylesheets/form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
form {
display: block;
}

form.section {
padding-left: 10%;
}

form.inline, form.inline input {
display: inline;
}


div.fieldWithErrors, div.formError {
border: 0;
display: inline;
margin: 0;
padding: 0;
}

div.formError {
color: red;
}

div.fieldWithErrors input, div.fieldWithErrors textarea, div.fieldWithErrors select {
color: black;
}
form fieldset {
margin: 1em;
padding: 1em;
}

form fieldset legend {
font-size: 1.8em;
}

form fieldset legend + div {
margin-top: 1em;
}

form fieldset + fieldset {
padding-top: 1em;
}

form div {
clear: both;
}



form div + div {
padding-top: 1em;
}

form fieldset div div.fieldWithErrors {
clear: none;
display: inline;
}

form input {
font-size: 1em;
}

form input.hidden, form input[type="hidden"] {
border: 0;
display: none;
margin: 0;
padding: 0;
}

form input.text, form input[type="text"],
form input.password, form input[type="password"],
form textarea {
letter-spacing: 1px;
}



/* horizontal forms */

form.horizontal div.formError {
display: block;
margin-left: 14.3em;
}

form.horizontal div.formError {
color: red;
}

form.horizontal div label, form.horizontal div input, form.horizontal div textarea, form.horizontal div p {
display: block;
}

form.horizontal div label {
padding: .5em;
float: left;
font-size: .95em;
text-align: right;
width: 13.8em;
}

form.horizontal div input, form.horizontal div textarea, form.horizontal div p {
margin-left: 14.3em;
}

form div input, form.horizontal div textarea {
border: 2px solid;
padding: .5em;
text-align: left;
width: 15em;
}

form.horizontal input.hidden, form.horizontal input[type="hidden"] {
border: 0;
display: none;
margin: 0;
padding: 0;
}

form.horizontal div input.button, form.horizontal div input[type="button"],
form.horizontal div input.submit, form.horizontal div input[type="submit"] {
padding: .2em .6em;
text-align: center;
width: auto;
}

form.horizontal div input.checkbox, form.horizontal div input[type="checkbox"],
form.horizontal div input.radio, form.horizontal div input[type="radio"] {
width: 1.1em;
height: 1.1em;
}

form.horizontal div.checkboxes {
padding-left: 11.5em;
}

form.horizontal div.checkboxes input.checkbox, form.horizontal div.checkboxes input[type="checkbox"],
form.horizontal div.radios input.radio, form.horizontal div.radios input[type="radio"],
form.horizontal div.checkboxes label, form.horizontal div.radios label {
display: inline;
float: none;
margin: 0;
}

form.horizontal p {
width: 20em;
}
15 changes: 0 additions & 15 deletions public/stylesheets/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@ div#footer {
clear: both;
}

div.fieldWithErrors, div.formError {
border: 0;
display: inline;
margin: 0;
padding: 0;
}

div.formError {
color: red;
}

div.fieldWithErrors input, div.fieldWithErrors textarea, div.fieldWithErrors select {
color: black;
}

div.flash.error {
color: red;
}
Expand Down
39 changes: 39 additions & 0 deletions public/stylesheets/list.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
dl dt, dl dd {
display: block;
line-height: 1.5em;
}

dl dt {
font-weight: bold;
float: left;
text-align: right;
width: 11em;
}

dl dd {
padding-left: 11.5em;
}

dl dd + dt, dl dd + dt + dd {
padding-top: .8em;
}

li + li {
margin-top: 1em;
}

ol.full li, ul.full li {
border-top: 3px solid;
border-bottom: 3px solid;
margin: 0;
padding: 1em;
width: 95%;
}

ol.full li + li, ul.full li + li {
border-top: 0;
}

ul.errors {
margin-left: 1em;
}
31 changes: 31 additions & 0 deletions public/stylesheets/table.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
table {
border-spacing: 0 .2em;
}

table.section {
width: 95%;
}

table th, table td {
padding: 1em;
}

table th {
font-weight: bold;
}

table tbody tr + tr td, table tbody tr + tr th {
border-top: 3px solid black;
}

table tr th, table tr td {
text-align: left;
}

table tr th + th, table tr td + td {
text-align: center;
}

table td {
padding: .1em;
}

0 comments on commit dc360cf

Please sign in to comment.