Custom version
You can customize your version of ridestyler.ui by editing Sass files in /src
directory or removing unneeded components from .scss
source files.
Compiling CSS
ridestyler.ui uses Gulp for compiling CSS. Firstly you need to install NPM, which is used to manage Gulp and other dependencies.
Then, you can build the CSS file from the command line:
- Navigate to the root directory of ridestyler.ui.
- Run
npm install
. NPM will install all dev dependencies as listed in package.json. - When completed, run
gulp build
task to compile Sass to CSS and minify files. - You can find compiled CSS files in
/dist
directory.
All available Gulp tasks:
gulp build
- compile both the CSS and documentationgulp scss
- compile just the CSSgulp docs
- compile just the documentationgulp fonts
- compile the icon fontgulp watch
- watch file changes and re-compile CSS files and documentation as neededgulp serve
- start a web-server hosting the documentation; watch for file changes and live-reload as needed.
Importing SCSS
It is recommended to customize ridestyler.ui by importing SCSS source files to your projects. In this way, you can keep ridestyler.ui up to date without conflicts, since ridestyler.ui code and your custom code are separate.
- First, create your own project and install ridestyler.ui via NPM or other package managers.
- Then inside your on SCSS file override variables as needed and import ridestyler.ui
- Compile the SCSS file to CSS to get the custom version of ridestyler.ui.
// Define variables to override default ones
$primary-color: #2e5bec;
$dark-color: #3e396b;
// Import full ridestyler.ui source code
@import "~ridestyler.ui";
Folder structure
ridestyler.ui/
├── dist/ // Build folder
│ ├── rsui.css
│ ├── rsui.min.css
│ ├── rsui-icons.css // Icons-only build
│ └── rsui-icons.min.css
│
├── docs/
│ ├── dist/ // Pre-built CSS folder
│ │ ├── rsui.min.css
│ │ └── rsui-icons.min.css
│ ├── css/ // Built docs CSS files
│ │ └── docs.css
│ ├── src/
│ │ ├── scss // Docs Sass files
│ │ │ └── docs.scss
│ │ ├── index.pug // Docs Pug files
│ │ └── ...
│ ├── ../
│ ├── index.html
│ └── ...
│
├── src/ // Source Sass files
│ ├── index.scss
│ ├── _mixins.scss
│ ├── _variables.scss
│ └── ...
│
├── gulpfile.js
├── package.json
└── ...
Variables
ridestyler.ui is designed with consistent design language. You can use your own variables to create your new or match existing design. All variables in _variables.scss
include !default
flag. You can redefine the variables to override the values.
Variables - Colors
Variables - Button mixins
There is a button variant mixin in _mixins.scss
to generate different color variants.
- @mixin button-variant(
$color
: $primary-color);
<!-- filled button with the success color -->
.btn-success {
@include button-variant($success-color);
}
Variables - Sizes
The default REM (root em) size in ridestyler.ui is .