The Sephora Style Guide is a front-end framework similar to Twitter Bootstrap (and modelled closely to it) which provides the Sephora Digital SEA team with a set of reusable and composable components to work with.
Add it to your Gemfile:
gem 'sephora_style_guide', git: 'https://github.com/luxola/sephora-style-guide', branch: 'master'
Run the following command to install it:
$ bundle
You can now include the style guide base file in your application.scss
:
@import 'sephora_style_guide/base';
For JS modules, you will need to manually include them in your application.js
:
// = require sephora_style_guide/modal
If you need the documentation page, you can add it by mounting the engine in your config/routes.rb
:
mount SephoraStyleGuide::Engine => '/style-guide'
If you are using Yarn:
$ yarn add sephora-style-guide
Or when using npm:
$ npm install sephora-style-guide --save
You can now include the style guide elements (variables, mixins...) in your SCSS files:
@import '~sephora-style-guide/app/assets/stylesheets/sephora_style_guide/variables';
@import '~sephora-style-guide/app/assets/stylesheets/sephora_style_guide/mixins';
In the Ecomm main app, these variables and mixins are automatically included via the style-resources-loader
.
View the live examples here
- Clone the repo inside the same folder as the main app.
- In your main app
Gemfile
:
gem 'sephora_style_guide', path: '../sephora-style-guide'
- In your main app
package.json
:
"sephora-style-guide": "file:../sephora-style-guide"
- Run
bundle install
andyarn install
. You should see changes in yourGemfile.lock
as well asyarn.lock
. - Restart your server. Any changes you make in the style guide should now reflect immediately in the main app.
- Work on you own branch from the beginning. Branch name should be something like this:
stories/add_new_font_sephora_sans_shop_426
- Once you are done, issue the PR.
- Test the changes in the main app. This can be done by specifying the branch as the target in
Gemfile
andpackage.json
:
gem 'sephora_style_guide', github: 'sephora-sea/sephora-style-guide', branch: 'stories/add_new_font_sephora_sans_shop_426'
"sephora-style-guide": "luxola/sephora-style-guide#stories/add_new_font_sephora_sans_shop_426",
- After it has been reviewed and tested, bump package version (see below).
- Then merge to master and re-point main app to gem’s master (see below).
- Bump the package version in the
package.json
file. - Use semantic versioning for convention.
- To avoid any npm cache issue.
- Undo any changes made to
Gemfile
andpackage.json
. - Run
bundle update --source sephora_style_guide
. You will see a message like this: "Bundler attempted to update sephora_style_guide but its version stayed the same". However, this will usually refer to the version of the style guide gem, for example0.0.5
, which doesn't update that often. If you check yourGemfile.lock
, you should see changes to therevision
part with the commit hash of the latest changes in style guide. - Run
yarn upgrade sephora-style-guide
, update the package version in theyarn.lock
file to synchronize the package version. - Commit the changes and you are done!
The gem is available as open source under the terms of the MIT License.