@@ -43,19 +43,19 @@ <h1>Examples</h1>
43
43
44
44
< h2 > CSS</ h2 >
45
45
< pre class ="language-css "> < code > .example-gradient {
46
- background: -moz -linear-gradient(left, #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* FF3.6 + */
47
- background: -webkit -linear-gradient(left, #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* Chrome10+,Safari5.1 + */
48
- background: -o -linear-gradient(left, #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* Opera 11.10 + */
49
- background: -ms -linear-gradient(left, #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* IE10 + */
50
- background: linear-gradient(to right, #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* W3C */
46
+ background: -webkit -linear-gradient(left, #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* Chrome10+, Safari5.1 + */
47
+ background: -moz -linear-gradient(left, #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* FF3.6 + */
48
+ background: -ms -linear-gradient(left, #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* IE10 + */
49
+ background: -o -linear-gradient(left, #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* Opera 11.10 + */
50
+ background: linear-gradient(to right, #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* W3C */
51
51
}
52
52
.example-angle {
53
53
transform: rotate(10deg);
54
54
}
55
55
.example-color {
56
56
color: rgba(255, 0, 0, 0.2);
57
57
background: purple;
58
- border: 1px solid hsl(100,70%,40%);
58
+ border: 1px solid hsl(100, 70%, 40%);
59
59
}
60
60
.example-easing {
61
61
transition-timing-function: linear;
@@ -69,13 +69,13 @@ <h2>Markup attributes</h2>
69
69
<tr style="background: lightblue;"> </ code > </ pre >
70
70
71
71
< h2 > Less</ h2 >
72
- < pre class ="language-less "> < code > @gradient: linear-gradient(135deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%);
72
+ < pre class ="language-less "> < code > @gradient: linear-gradient(135deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%);
73
73
.example-gradient {
74
- background: -moz -linear-gradient(-45deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* FF3.6 + */
75
- background: -webkit -linear-gradient(-45deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Chrome10+,Safari5.1 + */
76
- background: -o -linear-gradient(-45deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Opera 11.10 + */
77
- background: -ms -linear-gradient(-45deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* IE10 + */
78
- background: linear-gradient(135deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* W3C */
74
+ background: -webkit -linear-gradient(-45deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* Chrome10+, Safari5.1 + */
75
+ background: -moz -linear-gradient(-45deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* FF3.6 + */
76
+ background: -ms -linear-gradient(-45deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* IE10 + */
77
+ background: -o -linear-gradient(-45deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* Opera 11.10 + */
78
+ background: linear-gradient(135deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* W3C */
79
79
}
80
80
@angle: 3rad;
81
81
.example-angle {
@@ -85,7 +85,7 @@ <h2>Less</h2>
85
85
.example-color {
86
86
color: hsla(102, 53%, 42%, 0.4);
87
87
}
88
- @easing: cubic-bezier(0.1,0.3,1, .4);
88
+ @easing: cubic-bezier(0.1, 0.3, 1, .4);
89
89
.example-easing {
90
90
transition-timing-function: ease;
91
91
}
@@ -95,20 +95,20 @@ <h2>Less</h2>
95
95
}</ code > </ pre >
96
96
97
97
< h2 > Sass</ h2 >
98
- < pre class ="language-sass "> < code > $gradient: linear-gradient(135deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%)
98
+ < pre class ="language-sass "> < code > $gradient: linear-gradient(135deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%)
99
99
@mixin example-gradient
100
- background: -moz-radial-gradient(center, ellipse cover, #f2f6f8 0%, #d8e1e7 50%, #b5c6d0 51%, #e0eff9 100%)
101
- background: radial-gradient(ellipse at center, #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%)
100
+ background: -moz-radial-gradient(center, ellipse cover, #f2f6f8 0%, #d8e1e7 50%, #b5c6d0 51%, #e0eff9 100%)
101
+ background: radial-gradient(ellipse at center, #f2f6f8 0%, #d8e1e7 50%, #b5c6d0 51%, #e0eff9 100%)
102
102
$angle: 380grad
103
103
@mixin example-angle
104
104
transform: rotate(-120deg)
105
105
.example-angle
106
106
transform: rotate(18rad)
107
107
$color: blue
108
108
@mixin example-color
109
- color: rgba(147, 32, 34, 0.8)
109
+ color: rgba(147, 32, 34, 0.8)
110
110
.example-color
111
- color: pink
111
+ color: pink
112
112
$easing: ease-out
113
113
.example-easing
114
114
transition-timing-function: ease-in-out
@@ -120,32 +120,32 @@ <h2>Sass</h2>
120
120
</ code > </ pre >
121
121
122
122
< h2 > Scss</ h2 >
123
- < pre class ="language-scss "> < code > $gradient: linear-gradient(135deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%);
123
+ < pre class ="language-scss "> < code > $gradient: linear-gradient(135deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%);
124
124
$attr: background;
125
125
.example-gradient {
126
- #{$attr}-image: repeating-linear-gradient(10deg, rgba(255,0,0, 0), rgba(255,0,0, 1) 10px, rgba(255,0,0, 0) 20px);
126
+ #{$attr}-image: repeating-linear-gradient(10deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 1) 10px, rgba(255, 0, 0, 0) 20px);
127
127
}
128
128
$angle: 1.8turn;
129
129
.example-angle {
130
130
transform: rotate(-3rad)
131
131
}
132
132
$color: blue;
133
133
.example-color {
134
- #{$attr}-color: rgba(255,255,0, 0.75);
134
+ #{$attr}-color: rgba(255, 255, 0, 0.75);
135
135
}
136
136
$easing: linear;
137
137
.example-easing {
138
- transition-timing-function: cubic-bezier(0.9,0.1,.2,.4);
138
+ transition-timing-function: cubic-bezier(0.9, 0.1, .2, .4);
139
139
}
140
140
$time: 1s;
141
141
.example-time {
142
142
transition-duration: 10s
143
143
}</ code > </ pre >
144
144
145
145
< h2 > Stylus</ h2 >
146
- < pre class ="language-stylus "> < code > gradient = linear-gradient(135deg, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%)
146
+ < pre class ="language-stylus "> < code > gradient = linear-gradient(135deg, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%)
147
147
.example-gradient
148
- background-image: repeating-radial-gradient(circle, rgba(255,0,0, 0), rgba(255,0,0, 1) 10px, rgba(255,0,0, 0) 20px)
148
+ background-image: repeating-radial-gradient(circle, rgba(255, 0, 0, 0), rgba(255, 0, 0, 1) 10px, rgba(255, 0, 0, 0) 20px)
149
149
angle = 357deg
150
150
.example-angle
151
151
transform: rotate(100grad)
@@ -166,15 +166,16 @@ <h1>Disabling a previewer</h1>
166
166
can be added on a code block or any ancestor. Its value should be a space-separated list of previewers
167
167
representing the subset.</ p >
168
168
< p > For example:</ p >
169
- < pre class ="language-markup "> < code > <pre class="language-css" data-previewers="color"> <code> div {
170
- /* Only the previewer for colors is enabled */
169
+ < pre class ="language-markup "> < code > <pre class="language-css" data-previewers="color time "> <code> div {
170
+ /* Only the previewer for color and time are enabled */
171
171
color: red;
172
+ transition-duration: 1s;
172
173
/* The previewer for angles is not enabled. */
173
174
transform: rotate(10deg);
174
175
}</code> </pre> </ code > </ pre >
175
176
< p > will give the following result:</ p >
176
177
< pre class ="language-css " data-previewers ="color time "> < code > div {
177
- /* Only the previewers color and time are enabled */
178
+ /* Only the previewers for color and time are enabled */
178
179
color: red;
179
180
transition-duration: 1s;
180
181
/* The previewer for angles is not enabled. */
@@ -184,30 +185,30 @@ <h1>Disabling a previewer</h1>
184
185
185
186
< section >
186
187
< h1 > API</ h1 >
187
- < p > This plugins provides a constructor that can be accessed through < code > Prism.plugins.Previewer</ code > .</ p >
188
+ < p > This plugins provides a constructor that can be accessed through < code class =" language-javascript " > Prism.plugins.Previewer</ code > .</ p >
188
189
< p > Once a previewer has been instantiated, an HTML element is appended to the document body.
189
190
This element will appear when specific tokens are hovered.</ p >
190
191
191
- < h2 > < code > new Prism.plugins.Previewer(type, updater, supportedLanguages)</ code > </ h2 >
192
+ < h2 > < code class =" language-javascript " > new Prism.plugins.Previewer(type, updater, supportedLanguages)</ code > </ h2 >
192
193
193
194
< ul >
194
195
< li >
195
- < p > < code > type</ code > : the token type this previewer is associated to.
196
+ < p > < code class =" language-javascript " > type</ code > : the token type this previewer is associated to.
196
197
The previewer will be shown when hovering tokens of this type.</ p >
197
198
</ li >
198
199
< li >
199
- < p > < code > updater</ code > : the function that will be called each time an associated token is hovered.
200
+ < p > < code class =" language-javascript " > updater</ code > : the function that will be called each time an associated token is hovered.
200
201
This function takes the text content of the token as its only parameter.
201
- The previewer HTML element can be accessed through the keyword < code > this</ code > .
202
- This function must return < code > true</ code > for the previewer to be shown.</ p >
202
+ The previewer HTML element can be accessed through the keyword < code class =" language-javascript " > this</ code > .
203
+ This function must return < code class =" language-javascript " > true</ code > for the previewer to be shown.</ p >
203
204
</ li >
204
205
< li >
205
- < p > < code > supportedLanguages</ code > : an optional array of supported languages.
206
+ < p > < code class =" language-javascript " > supportedLanguages</ code > : an optional array of supported languages.
206
207
The previewer will be available only for those.
207
- Defaults to < code > '*'</ code > , which means every languages.</ p >
208
+ Defaults to < code class =" language-javascript " > '*'</ code > , which means every languages.</ p >
208
209
</ li >
209
210
< li >
210
- < p > < code > initializer</ code > : an optional function.
211
+ < p > < code class =" language-javascript " > initializer</ code > : an optional function.
211
212
This function will be called when the previewer is initialized,
212
213
right after the HTML element has been appended to the document body.</ p >
213
214
</ li >
0 commit comments