Skip to content

Commit 23b4eeb

Browse files
author
Mattia Roccoberton
committed
Minor improvements
1 parent b4c7949 commit 23b4eeb

3 files changed

Lines changed: 48 additions & 2 deletions

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Features:
77
- CSS only theme with clean UI
88
- compact nested forms
99
- [customizable](#customize) options: colors, sidebar position, squared style, scroll on cells
10-
- custom controls / components: [toggle](#toggle), [Sidebar menu](#sidebar-menu), [Accordion](#accordion), [Readonly field](#readonly-field)
10+
- custom controls / components: [toggle](#toggle), [Sidebar menu](#sidebar-menu), [Accordion](#accordion), [Readonly field](#readonly-field), [Styled table](#styled-table)
1111
- Blaze CSS [widgets](#blaze-widgets)
1212

1313
## Install
@@ -163,6 +163,16 @@ Some readonly fields in a form:
163163

164164
`f.readonly nil, 'Value only, no label'`
165165

166+
### Styled table
167+
168+
Table styles:
169+
170+
```ruby
171+
table_for User.all, class: 'blaze-table table-rows table-striped' do
172+
# ...
173+
end
174+
```
175+
166176
## Blaze widgets
167177

168178
See components avaible in Blaze CSS [docs](http://blazecss.com/components/buttons/).

app/assets/stylesheets/activeadmin_blaze_theme/theme.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,42 @@ body.active_admin {
883883
.sidebar_section .blaze-menu {
884884
margin-bottom: 4px;
885885
}
886+
.blaze-table {
887+
@extend .c-table;
888+
// @extend .c-table--striped;
889+
// @extend .c-table--condensed;
890+
>thead {
891+
@extend .c-table__head;
892+
>tr {
893+
@extend .c-table__row;
894+
@extend .c-table__row--heading;
895+
>th {
896+
@extend .c-table__cell;
897+
}
898+
}
899+
}
900+
>tbody {
901+
@extend .c-table__body;
902+
>tr {
903+
@extend .c-table__row;
904+
>td {
905+
@extend .c-table__cell;
906+
}
907+
}
908+
}
909+
&.table-bordered {
910+
border: 1px solid #ddd;
911+
&.table-rows {
912+
border-bottom: 0 none;
913+
}
914+
}
915+
&.table-rows >tbody >tr {
916+
border-bottom: 1px solid #ddd;
917+
}
918+
&.table-striped >tbody >tr.even {
919+
background: #f4f4f4;
920+
}
921+
}
886922

887923
// special components
888924
.filter_form .select-one-inputs {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ActiveAdminBlazeTheme
2-
VERSION = '0.5.9'
2+
VERSION = '0.5.10'
33
end

0 commit comments

Comments
 (0)