diff options
4 files changed, 448 insertions, 0 deletions
| -rw-r--r-- | docs/src/getting-started/browsers.pug | 41 | ||||
| -rw-r--r-- | docs/src/getting-started/custom.pug | 303 | ||||
| -rw-r--r-- | docs/src/getting-started/installation.pug | 84 | ||||
| -rw-r--r-- | docs/src/getting-started/whatsnew.pug | 20 |
diff --git a/docs/src/getting-started/browsers.pug b/docs/src/getting-started/browsers.pug new file mode 100644 index 0000000..91f0e65 --- /dev/null +++ b/docs/src/getting-started/browsers.pug @@ -0,0 +1,41 @@ +extends ../_layout/_docs-layout.pug + +block variables + - var slug = 'browsers' + - var parent = 'getting-started' + - var title = 'Browsers - Getting started - Spectre.css CSS Framework' + - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.' + +block docs-content + +docs-heading('browsers', 'Browser support') + include ../_layout/_ad-g.pug + + p + | Spectre uses + a(href='https://github.com/postcss/autoprefixer', target='_blank') Autoprefixer + | to make most styles compatible with earlier browsers and + a(href='https://necolas.github.io/normalize.css/', target='_blank') Normalize.css + | for CSS resets. Spectre is designed for modern browsers. For best compatibility, these browsers are recommended: + ul + li + | Chrome + small.label.label-success LAST 4 + li + | Microsoft Edge + small.label.label-success LAST 4 + li + | Firefox + small.label.label-success.text-uppercase Extended Support Release + li + | Safari + small.label.label-success LAST 4 + li + | Opera + small.label.label-success LAST 4 + li Internet Explorer 10+ + p + | Spectre supports Internet Explorer 10+, but some HTML5 and CSS3 features are not perfectly supported by Internet Explorer. + + include ../_layout/_ad-c.pug + + include ../_layout/_footer.pug
\ No newline at end of file diff --git a/docs/src/getting-started/custom.pug b/docs/src/getting-started/custom.pug new file mode 100644 index 0000000..2bd89ee --- /dev/null +++ b/docs/src/getting-started/custom.pug @@ -0,0 +1,303 @@ +extends ../_layout/_docs-layout.pug + +block variables + - var slug = 'custom' + - var parent = 'getting-started' + - var title = 'Custom - Getting started - Spectre.css CSS Framework' + - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.' + +block docs-content + +docs-heading('custom', 'Custom version') + include ../_layout/_ad-g.pug + + p + | You can customize your version of Spectre.css by editing Sass files in + code /src + | directory or removing unneeded components from + code .scss + | source files. + p + a.btn.btn-primary(href='https://github.com/picturepan2/spectre/', target='_blank') Sass Source Code + p + | If you are looking for Less version of Spectre.css, please switch to + code Less + | branch. + p + a.btn(href='https://github.com/picturepan2/spectre/tree/less', target='_blank') Less Branch + + +docs-subheading('compiling', 'Compiling CSS') + + p + | Spectre uses + a(href='http://gulpjs.com/', target='_blank') Gulp + | for compiling CSS. Firstly you need to + a(href='https://www.npmjs.com/get-npm', target='_blank') install NPM + | , which is used to manage Gulp and other dependencies. + p Then, you can build the CSS file from the command line: + ol + li Navigate to the root directory of Spectre. + li + | Run + code npm install + | . NPM will install all dev dependencies as listed in package.json. + li + | When completed, run + code gulp build + | task to compile Sass to CSS and minify files. + li + | You can find compiled CSS files in + code /dist + | directory. + p All available Gulp tasks: + ul + li + code gulp build + | - compile Sass to CSS and minify files (default) + li + code gulp docs + | - compile Docs related files + li + code gulp watch + | - watch file changes and re-compile CSS files + + +docs-subheading('importing', 'Importing Sass') + p + | It is recommended to customize Spectre by importing Sass source files to your projects. In this way, you can keep Spectre up to date without conflicts, since Spectre code and your custom code are separate. + ul + li + | First, create your own project and install Spectre via + a(href='#installation') NPM or other package managers + | . + li + | Then create your + code project-name.scss + | file in the root folder. You can use + code project-name.scss + | to define your variables. + li Compile the Sass file to CSS to get the custom version of Spectre. + + //- importing + pre.code(data-lang='Sass') + code + :highlight(lang="scss") + // Example of project-name.scss + // Define variables to override default ones + $primary-color: #2e5bec; + $dark-color: #3e396b; + + // Import full Spectre source code + @import "node_modules/spectre.css/src/spectre"; + + p + | Alternatively, you can create custom + code _variables.scss + | and import it to + code project-name.scss + | . + + //- custom variables + pre.code(data-lang='Sass') + code + :highlight(lang="scss") + // Example of project-name.scss + @import "variables"; + + // Import only the needed components + @import "node_modules/spectre.css/src/buttons"; + @import "node_modules/spectre.css/src/forms"; + + +docs-subheading('folders', 'Folder structure') + + //- folder structure + pre.code + code + :highlight + spectre/ + ├── dist/ // Build folder + │ ├── spectre-exp.css + │ ├── spectre-exp.min.css + │ ├── spectre-icons.css + │ ├── spectre-icons.min.css + │ ├── spectre.css + │ └── spectre.min.css + │ + ├── docs/ + │ ├── dist/ // Pre-built CSS folder + │ │ ├── spectre-exp.css + │ │ ├── spectre-exp.min.css + │ │ ├── spectre-icons.css + │ │ ├── spectre-icons.min.css + │ │ ├── spectre.css + │ │ └── spectre.min.css + | ├── css/ // Docs CSS files + │ │ └── docs.css + | ├── src/ + │ │ ├── scss // Docs Sass files + │ │ │ └── docs.scss + │ │ ├── index.pug // Docs Pug files + │ │ └── ... + │ ├── examples/ // Example tempalte + │ │ └── starter.html + │ ├── ../ + │ ├── index.html + │ └── ... + │ + ├── src/ // Source Sass files + │ ├── spectre.scss + │ ├── spectre-icons.scss + │ ├── spectre-exp.scss + │ ├── _mixins.scss + │ ├── _variables.scss + │ └── ... + │ + ├── gulpfile.js + ├── package.json + └── ... + + +docs-subheading('variables', 'Variables') + + p + | Spectre.css is designed with consistent design language. You can use your own variables to create your new or match existing design. All variables in + code _variables.scss + | include + code !default + | flag. You can redefine the variables to override the values. + + +docs-subheading('variables-colors', 'Variables - Colors') + + .columns + .column.col-3.col-md-6 + .docs-color(style='background:#5755d9;color:#fff;') + .color-title #5755d9 + .color-subtitle Primary + .column.col-3.col-md-6 + .docs-color(style='background:#f1f1fc;color:#5755d9;') + .color-title #f1f1fc + .color-subtitle Secondary + .columns + .column.col-3.col-md-6 + .docs-color(style='background:#32b643;color:#fff;') + .color-title #32b643 + .color-subtitle Success + .column.col-3.col-md-6 + .docs-color(style='background:#ffb700;color:#fff;') + .color-title #ffb700 + .color-subtitle Warning + .column.col-3.col-md-6 + .docs-color(style='background:#e85600;color:#fff;') + .color-title #e85600 + .color-subtitle Error + .columns + .column.col-3.col-md-6 + .docs-color(style='background:#303742;color:#fff;') + .color-title #303742 + .color-subtitle Dark + .column.col-3.col-md-6 + .docs-color(style='background:#66758c;color:#fff;') + .color-title #66758c + .color-subtitle Gray dark + .column.col-3.col-md-6 + .docs-color(style='background:#bcc3ce;color:#303742;') + .color-title #bcc3ce + .color-subtitle Gray + .column.col-3.col-md-6 + .docs-color(style='background:#f7f8f9;color:#303742;') + .color-title #f7f8f9 + .color-subtitle Gray light + .column.col-3.col-md-6 + .docs-color(style='background:#bcc3ce;color:#303742;') + .color-title #bcc3ce + .color-subtitle Border + .column.col-3.col-md-6 + .docs-color(style='background:#f7f8f9;color:#303742;') + .color-title #f7f8f9 + .color-subtitle Background + .column.col-3.col-md-6 + .docs-color(style='background:#fff;color:#303742;') + .color-title #fff + .color-subtitle Light + + +docs-subheading('variables-buttons', 'Variables - Button mixins') + + p + | There are 2 button variant mixins in + code _mixins.scss + | to generate different color variants. + ul + li + | @mixin button-variant( + code $color + | : $primary-color); + li + | @mixin button-outline-variant( + code $color + | : $primary-color); + + //- button mixins + pre.code(data-lang='Sass') + code + :highlight(lang="scss") + <!-- filled button with the success color --> + .btn-success { + @include button-variant($success-color); + } + + <!-- outlined button with the success color --> + .btn-outline-success { + @include button-outline-variant($success-color); + } + + +docs-subheading('variables-sizes', 'Variables - Sizes') + + p + | The default REM (root em) size in Spectre.css is + code 20px + | . + p + | Please note in the Chinese/Japanese/Korean version, Chrome uses 12px as default minimum font size. That is why Spectre sets rem default html font size to + code 20px + | , which is relatively easy to calculate. + p + | Spectre uses + code 4px + | as the unit size. Sizes of components are based on the unit size. + + +docs-subheading('variables-custom-prefix', 'Variables - Custom prefix') + p + | There is also a way to add custom prefix to all CSS classes. You can use + a(href='https://www.npmjs.com/package/gulp-css-prefix', target='_blank') gulp-css-prefix + | plugin and add a new Gulp task to enable it. + + //- custom prefix + pre.code(data-lang='Bash') + code + :highlight(lang="Bash") + npm install gulp-css-prefix + + p + | To add + code spectre- + | to all classes, you can add the Gulp task to + code gulpfile.js + | file. + + //- custom prefix + pre.code + code + :highlight(lang="JavaScript") + var cssPrefix = require('gulp-css-prefix'); + + gulp.task('prefix', function() { + gulp.src('./dist/*.css') + .pipe(cssPrefix('spectre-')) + .pipe(gulp.dest('./dist')) + }); + + p + | After you compile your version of Spectre in the /dist, run + code gulp prefix + | in the directory of Spectre. + + include ../_layout/_ad-c.pug + + include ../_layout/_footer.pug
\ No newline at end of file diff --git a/docs/src/getting-started/installation.pug b/docs/src/getting-started/installation.pug new file mode 100644 index 0000000..387e7bf --- /dev/null +++ b/docs/src/getting-started/installation.pug @@ -0,0 +1,84 @@ +extends ../_layout/_docs-layout.pug + +block variables + - var slug = 'installation' + - var parent = 'getting-started' + - var title = 'Installation - Getting started - Spectre.css CSS Framework' + - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.' + +block docs-content + +docs-heading('installation', 'Installation') + include ../_layout/_ad-g.pug + + p + | There are 5 ways to get started with Spectre CSS framework in your projects. You can either install manually, from CDN or use package managers. + + +docs-subheading('install-manually', 'Install manually') + p + | Download the compiled and minified + a(href='https://github.com/picturepan2/spectre/releases', target='_blank') Spectre CSS file + | (core ~10KB min+gzip): + p + a.btn.btn-primary(href='https://github.com/picturepan2/spectre/releases', target='_blank') Download Spectre.css + p + | Include + code spectre.css + | located in + strong /dist + | in your website or Web app <head>. Also, you can add + code spectre-icons.css + | and + code spectre-exp.css + | accordingly. + + //- install manually + pre.code(data-lang='HTML') + code + :highlight(lang="html") + <link rel="stylesheet" href="spectre.min.css"> + <link rel="stylesheet" href="spectre-exp.min.css"> + <link rel="stylesheet" href="spectre-icons.min.css"> + + +docs-subheading('install-cdn', 'Install from CDN') + p + | Alternatively, you can use the + a(href='https://unpkg.com/', target='_blank') unpkg + | or + a(href='https://cdnjs.com/libraries/spectre.css', target='_blank') cdnjs + | CDN to load compiled Spectre.css. + + //- install from CDN + pre.code(data-lang='HTML') + code + :highlight(lang="html") + <link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css"> + <link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-exp.min.css"> + <link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-icons.min.css"> + + +docs-subheading('install-npm', 'Install with NPM') + + //- install with npm + pre.code.c-select-all(data-lang='Bash') + code + :highlight(lang="Bash") + npm install spectre.css --save + + +docs-subheading('install-yarn', 'Install with Yarn') + + //- install with yarn + pre.code.c-select-all(data-lang='Bash') + code + :highlight(lang="bash") + yarn add spectre.css + + +docs-subheading('install-bower', 'Install from Bower') + + //- install with bower + pre.code.c-select-all(data-lang='Bash') + code + :highlight(lang="bash") + bower install spectre.css --save + + include ../_layout/_ad-c.pug + + include ../_layout/_footer.pug
\ No newline at end of file diff --git a/docs/src/getting-started/whatsnew.pug b/docs/src/getting-started/whatsnew.pug new file mode 100644 index 0000000..4354e98 --- /dev/null +++ b/docs/src/getting-started/whatsnew.pug @@ -0,0 +1,20 @@ +extends ../_layout/_docs-layout.pug + +block variables + - var slug = 'whatsnew' + - var parent = 'getting-started' + - var title = 'What\'s New - Getting started - Spectre.css CSS Framework' + - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.' + +block docs-content + +docs-heading('whatsnew', 'What\'s new') + include ../_layout/_ad-g.pug + + include:markdown-it ../../../changelog.md + + p + a.btn.btn-primary(href='https://github.com/picturepan2/spectre/releases', target='_blank') Releases + + include ../_layout/_ad-c.pug + + include ../_layout/_footer.pug
\ No newline at end of file |