You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-34
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,18 @@ Options passed to gulp-less
153
153
154
154
This class is added to all preview blocks in the generated styleguide. If your styles have some namespace class that needs to be added to every block and you do not want to add it to every example you can use commonClass option.
155
155
156
+
**server** (boolean, optional)
157
+
158
+
Enable built-in web-server. To enable Desiger tools styleguide must be server with built-in web-server. Server has also ability to refresh changed styles or KSS markup without doing the full page reload.
159
+
160
+
**port** (number, optional)
161
+
162
+
Port of the server. Default is 3000.
163
+
164
+
**rootPath** (string, optional)
165
+
166
+
Server root path. This must be defined if you run built-in server via gulp or grunt task. Point to the same path as styleguide output folder.
167
+
156
168
**appRoot** (string, optional)
157
169
158
170
Define `appRoot` parameter if you host styleguide in other than root folder of the HTTP serve. If
@@ -184,40 +196,6 @@ Configuration array containing paths to the dependencies of the hosted applicati
184
196
185
197
Note: When using templateUrl in directives, the template path is relative to styleguide index.html, not the hosted application root.
186
198
187
-
## Built-in server
188
-
189
-
Styleguide contains built-in web-server to host the styleguide. To enable [Desiger tools](#designer-tools) styleguide must be server with built-in web-server.
190
-
191
-
### Using CLI
192
-
193
-
Built-in server is started when styleguide is started with `--server` or with `--watch` parameters.
194
-
195
-
### Using Gulp
196
-
197
-
var server = require("sc5-styleguide").server;
198
-
199
-
gulp.task("server", function() {
200
-
styleguide.server({
201
-
rootPath: <styleguide root path>,
202
-
sassVariables: <path to sass variables file>
203
-
});
204
-
});
205
-
206
-
### Automatically apply changed styles to styleguide
207
-
208
-
Styleguide has ability to use changed styles without reloading the whole page. To enable this feature you must call `server.io.emitChanges()` when the styleguide is generated.
209
-
210
-
return gulp.src(sourcePaths)
211
-
.pipe(styleguide(options))
212
-
.pipe(gulp.dest(outputPath))
213
-
.on('end', function() {
214
-
// Styleguide is updated
215
-
// Send message to active clients to refresh the new CSS
216
-
if (server && server.io) {
217
-
server.io.emitChanges();
218
-
}
219
-
});
220
-
221
199
## Documenting syntax
222
200
223
201
Document your CSS components with [KSS](http://warpspire.com/kss/)
0 commit comments