mirror of https://github.com/twbs/ratchet.git
4 changed files with 261 additions and 297 deletions
@ -1,118 +1,120 @@ |
|||||||
/* Table views |
// |
||||||
-------------------------------------------------- */ |
// Table views |
||||||
|
// -------------------------------------------------- |
||||||
|
|
||||||
// Remove usual bullet styles from table view |
|
||||||
.table-view { |
.table-view { |
||||||
list-style: none; |
list-style: none; // Remove usual bullet styles from table view |
||||||
background-color: #fff; |
background-color: #fff; |
||||||
} |
|
||||||
|
// Pad each table view item and add dividers |
||||||
// Pad each table view item and add dividers |
li { |
||||||
.table-view li { |
position: relative; |
||||||
position: relative; |
padding: 11px 60px 11px 0; // Given extra right padding to accomodate counts, chevrons or buttons |
||||||
padding: 11px 60px 11px 0; // Given extra right padding to accomodate counts, chevrons or buttons |
margin-left: 15px; |
||||||
margin-left: 15px; |
border-bottom: 1px solid rgba(0, 0, 0, .1); |
||||||
border-bottom: 1px solid rgba(0, 0, 0, .1); |
} |
||||||
} |
|
||||||
|
// Give top border to first list items |
||||||
// Give top border to first list items |
li:first-child { |
||||||
.table-view li:first-child { |
border-top: 1px solid rgba(0, 0, 0, .1); |
||||||
border-top: 1px solid rgba(0, 0, 0, .1); |
} |
||||||
} |
|
||||||
|
// Remove the border from the last list item |
||||||
// Remove the border from the last list item |
li:last-child { |
||||||
.table-view li:last-child { |
border-bottom: 0; |
||||||
border-bottom: 0; |
} |
||||||
} |
|
||||||
|
// If a table view of links, make sure the child <a> takes up full table view item tap area (want to avoid selecting child buttons though) |
||||||
// If a table view of links, make sure the child <a> takes up full table view item tap area (want to avoid selecting child buttons though) |
li > a:not([class*="button"]) { |
||||||
.table-view li > a:not([class*="button"]) { |
position: relative; |
||||||
position: relative; |
display: block; |
||||||
display: block; |
padding: inherit; |
||||||
padding: inherit; |
margin: -11px -60px -11px 0; |
||||||
margin: -11px -60px -11px 0; |
color: inherit; |
||||||
color: inherit; |
} |
||||||
} |
|
||||||
|
|
||||||
/* Inset table view |
// Inset table views |
||||||
-------------------------------------------------- */ |
// -------------------------------------------------- |
||||||
|
|
||||||
.table-view.inset { |
&.inset { |
||||||
width: auto; |
width: auto; |
||||||
margin-right: 10px; |
margin-right: 10px; |
||||||
margin-left: 10px; |
margin-left: 10px; |
||||||
border: 1px solid rgba(0, 0, 0, .1); |
border: 1px solid rgba(0, 0, 0, .15); |
||||||
border-radius: 6px; |
border-radius: 6px; |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
} |
|
||||||
|
// Remove border from first/last standard list items to avoid double border at top/bottom of table views |
||||||
// Remove border from first/last standard list items to avoid double border at top/bottom of table views |
li:first-child { |
||||||
.table-view.inset li:first-child { |
border-top-width: 0; |
||||||
border-top-width: 0; |
} |
||||||
} |
li:last-child { |
||||||
.table-view.inset li:last-child { |
border-bottom-width: 0; |
||||||
border-bottom-width: 0; |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
/* table view dividers |
// Table view dividers |
||||||
-------------------------------------------------- */ |
// -------------------------------------------------- |
||||||
|
|
||||||
.table-view .table-view-divider { |
.table-view-divider { |
||||||
position: relative; |
position: relative; |
||||||
top: -1px; |
top: -1px; |
||||||
padding-top: 6px; |
padding-top: 6px; |
||||||
padding-bottom: 6px; |
padding-bottom: 6px; |
||||||
padding-left: 15px; |
padding-left: 15px; |
||||||
margin-left: 0; |
margin-left: 0; |
||||||
font-weight: bold; |
font-weight: bold; |
||||||
line-height: 18px; |
line-height: 18px; |
||||||
background-color: #f8f8f8; |
background-color: #f8f8f8; |
||||||
border-top: 1px solid rgba(0, 0, 0, .1); |
border-top: 1px solid rgba(0, 0, 0, .1); |
||||||
border-bottom: 1px solid rgba(0, 0, 0, .1); |
border-bottom: 1px solid rgba(0, 0, 0, .1); |
||||||
box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4); |
|
||||||
} |
/* Rounding first divider on inset lists and remove border on the top */ |
||||||
|
:first-child { |
||||||
/* Rounding first divider on inset lists and remove border on the top */ |
top: 0; |
||||||
.table-view.inset .table-view-divider:first-child { |
border-top-width: 0; |
||||||
top: 0; |
border-radius: 6px 6px 0 0; |
||||||
border-top-width: 0; |
} |
||||||
border-radius: 6px 6px 0 0; |
|
||||||
} |
/* Rounding last divider on inset table views */ |
||||||
|
:last-child { |
||||||
/* Rounding last divider on inset table views */ |
border-radius: 0 0 6px 6px; |
||||||
.table-view.inset .table-view-divider:last-child { |
} |
||||||
border-radius: 0 0 6px 6px; |
} |
||||||
} |
|
||||||
|
|
||||||
/* Right-aligned subcontent in table views (chevrons, buttons, counts and toggles) |
// Right-aligned subcontent in table views (chevrons, buttons, counts and toggles) |
||||||
-------------------------------------------------- */ |
// ------------------------------------------------------------------------------- |
||||||
.table-view .chevron, |
|
||||||
.table-view [class*="button"], |
.chevron, |
||||||
.table-view [class*="count"], |
[class*="button"], |
||||||
.table-view .toggle { |
[class*="count"], |
||||||
position: absolute; |
.toggle { |
||||||
top: 50%; |
position: absolute; |
||||||
right: 10px; |
top: 50%; |
||||||
} |
right: 10px; |
||||||
|
} |
||||||
/* Position chevrons/counts vertically centered on the right in table view items */ |
|
||||||
.table-view .chevron, |
// Position chevrons/counts vertically centered on the right in table view items |
||||||
.table-view [class*="count"] { |
.chevron, |
||||||
margin-top: -10px; /* Half height of chevron */ |
[class*="count"] { |
||||||
} |
margin-top: -10px; // Half height of chevron |
||||||
|
} |
||||||
/* Push count over if there's a sibling chevron */ |
|
||||||
.table-view .chevron + [class*="count"] { |
// Push count over if there's a sibling chevron |
||||||
|
.chevron + [class*="count"] { |
||||||
right: 30px; |
right: 30px; |
||||||
} |
} |
||||||
|
|
||||||
/* Position buttons vertically centered on the right in table view items */ |
// Position buttons vertically centered on the right in table view items |
||||||
.table-view [class*="button"] { |
[class*="button"] { |
||||||
left: auto; |
left: auto; |
||||||
margin-top: -14px; /* Half height of button */ |
margin-top: -14px; // Half height of button |
||||||
} |
} |
||||||
|
|
||||||
.table-view .toggle { |
.toggle { |
||||||
margin-top: -15px; /* Half height of toggle */ |
margin-top: -15px; // Half height of toggle |
||||||
|
} |
||||||
} |
} |
Loading…
Reference in new issue