Wiki source code of Style Macro (Radeox)

Last modified by Vincent Massol on 2016/06/05 22:11

Show last authors
1 Styles a block of content.
2
3 Internally it generates an HTML DIV or SPAN and supports many properties of these 2 elements.
4
5 The style macro be a superset of the existing info, warning, error and floatingbox macros. We need use some class match with those macros
6
7 == Usage ==
8
9 {{code language="none"}}
10 {style:type=<div|span>|id=<id>|class=<class>|align=<align>|font-size=<size>|color=<color>|font-family=<font>|width=<width>|height=<height>}text{style}
11 {{/code}}
12
13 === Parameters definition ===
14
15 Supported properties (note that all of them are properties that exist for DIVs and SPANs):
16
17 * id : id of span of div tag
18 * class (some classes: warningmessage,errormessage, infomessage, plainmessage, floatinginfobox,... matching with warning, error, info ... macros)
19 * name
20 * align : allow align a paragraph to left, center, right, full
21 * font-size
22 * font-family
23 * color
24 * background-color
25 * width
26 * height
27 * float
28 * border
29 * icon and document
30
31 ({style...|icon=msgwarning.jpg|document=Main.Mypage} if the document parameter is specified then it find msgwaring.jpg in attachments of Main.Mypage or current page or in icons directory , If it isn't found then it display image empty for icon
32
33 == Example ==
34
35 {{code language="none"}}
36 {style:type=div|color=red|width=50%|height=50%}
37 This is the content in div block
38 {style}
39 {{/code}}
40
41 Will generate the following when rendered:
42
43 {{code language="none"}}
44 <div style="color:red;width:50%;height=50%">
45 This is the content in div block
46 </div>
47 {{/code}}
48
49 or
50
51 {{code}}
52 {style:type=div|border=1px solid red|background-color=green|width=300px|height=300px|color=red|
53 icon=msgwarning.png|document=Main.Mypage}
54 This is the content of style macro
55 {style}
56 {{/code}}
57
58 === Result ===
59
60 (% style="color:red; width:50%; height:50%; " %)
61 (((
62 This is the content in div block
63 )))
64
65 or
66
67 [[image:stylemacro.JPG]]

Get Connected