File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 1
- # matestack core component: Hr
1
+ # matestack core component: U
2
2
3
- Show [ specs] ( /spec/usage/components/hr_spec .rb )
3
+ Show [ specs] ( /spec/usage/components/u_spec .rb )
4
4
5
- The HTML ` <u> ` tag implemented in ruby .
5
+ The HTML ` <u> ` tag implemented in Ruby .
6
6
7
7
## Parameters
8
8
9
- This component can take 2 optional configuration params.
9
+ This component can take 2 optional configuration params and either yield content or display what gets passed to the ` text ` configuration param .
10
10
11
11
#### # id (optional)
12
12
Expects a string with all ids the u should have.
13
13
14
14
#### # class (optional)
15
15
Expects a string with all classes the u should have.
16
16
17
+
17
18
## Example 1
18
19
Adding an optional id
19
20
20
21
``` ruby
21
22
div id: " foo" , class : " bar" do
22
- u id: " u-id"
23
+ u id: " u-id" do
24
+ plain ' Example text'
25
+ end
23
26
end
24
27
```
25
28
26
29
returns
27
30
28
31
``` html
29
32
<div id =" foo" class =" bar" >
30
- <u id =" u-id" >
33
+ <u id =" u-id" >Example text</ u >
31
34
</div >
32
35
```
33
36
@@ -36,14 +39,14 @@ Adding an optional class
36
39
37
40
``` ruby
38
41
div id: " foo" , class : " bar" do
39
- u class : " u-class"
42
+ u class : " u-class" , text: ' Example text '
40
43
end
41
44
```
42
45
43
46
returns
44
47
45
48
``` html
46
49
<div id =" foo" class =" bar" >
47
- <u class =" u-class" >
50
+ <u class =" u-class" >Example text</ u >
48
51
</div >
49
52
```
You can’t perform that action at this time.
0 commit comments