Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 6cf25b0

Browse files
authored
Merge pull request #79 from at-point/mapl-simple-form-fine-tuning
style fixes for simple_form and modes
2 parents 1f40eb2 + 11b3a87 commit 6cf25b0

File tree

5 files changed

+63
-6
lines changed

5 files changed

+63
-6
lines changed

.rubocop.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ Metrics/LineLength:
3131
Metrics/AbcSize:
3232
Max: 20
3333

34+
Metrics/BlockLength:
35+
CountComments: false
36+
Max: 25
37+
Exclude:
38+
- lib/generators/mtl/templates/simple_form.rb
39+
- spec/mtl/rails/card_file_presenter_spec.rb
40+
- spec/mtl/rails/card_file_presenter_spec.rb
41+
- spec/mtl/rails/view_helpers_spec.rb
42+
- spec/mtl/rails/view_helpers_spec.rb
43+
- spec/mtl/rails/view_helpers_spec.rb
44+
- spec/mtl/simple_form/suffix_spec.rb
45+
3446
Style/PercentLiteralDelimiters:
3547
PreferredDelimiters:
3648
'%r': '{}'

CHANGES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
21
ChangeLog
32
=========
43

4+
Version 1.0.2
5+
-------------
6+
- refined general radios and positionin [#79]
7+
- made hidden main labels visible again [#79]
8+
- added single line mode for radios [#79]
9+
10+
511
Version 1.0.0
612
-------------
713

REFERENCE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,25 @@ These can be used for units like currencies and more:
135135
If you use simple_form, check out our component extension: [SimpleForm/Components/Suffix](SimpleForm/Components/Suffix.html).
136136

137137

138+
### Radio buttons
139+
140+
We extended the default radio buttons with a horizontal mode. This will align radio buttons in one horizontal line, instead of breaking them to new lines.
141+
142+
```html
143+
<div class="input-field radio_buttons radio_buttons--horizontal">
144+
<p class="radio">
145+
<input class="radio_buttons" type="radio">
146+
<label class="collection_radio_buttons">Mr.</label>
147+
</p>
148+
<p class="radio">
149+
<input class="radio_buttons" type="radio">
150+
<label class="collection_radio_buttons">Mrs</label>
151+
</p>
152+
<label class="radio_buttons">Title</label>
153+
</div>
154+
```
155+
156+
138157
### Buttons
139158

140159
We added **square-button** to display an icon in a squared button.

app/assets/stylesheets/mtl/extend/_forms.scss

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
// scss-lint:disable QualifyingElement SelectorFormat
2-
.simple_form .check_boxes > label,
3-
.simple_form .radio_buttons > label {
4-
display: none;
5-
}
2+
3+
// caret fix
64
.select-wrapper span.caret {
75
color: inherit;
86
}
97

8+
.radio_buttons {
9+
padding: .8rem .75rem !important;
10+
11+
> label {
12+
top: 0;
13+
padding: 0 !important;
14+
font-size: .8rem;
15+
}
16+
}
17+
18+
// radio buttons in one line
19+
.radio_buttons--horizontal {
20+
> .radio {
21+
display: inline-block;
22+
23+
label {
24+
left: 0 !important;
25+
}
26+
}
27+
}
28+
1029
// fix for too long labels
1130
.input-field label {
1231
overflow: hidden;
@@ -16,6 +35,7 @@
1635
}
1736
.input-field.col label {
1837
padding-right: $gutter-width;
38+
left: .75rem;
1939
}
2040

2141
// fields with text suffix/unit

lib/mtl/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Mtl
2-
VERSION = '1.0.1'.freeze
2+
VERSION = '1.0.2'.freeze
33
MATERIALIZE_VERSION = '0.97.7'.freeze
44
ICONS_VERSION = '2.2.3'.freeze
55
LODASH_VERSION = '4.14.1'.freeze

0 commit comments

Comments
 (0)