Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
employer-style-base
Advanced tools
A stack-agnostic Sass library providing basic components and typography intended for the Employer experience
A stack-agnostic Sass library providing basic components and typography intended for the Employer experience.
View code and component examples in the pattern library.
Add and install with Yarn:
$ yarn add employer-style-base
Now, import sass/base
after any resets, Bourbon and FontAwesome, and before any grids and application sources in your main application.scss
. For example:
@import 'reset';
@import 'bourbon/app/assets/stylesheets/bourbon';
@import 'font-awesome';
@import 'employer-style-base/sass/base';
@import 'some-grid-foundation';
@import 'your-app';
You may now apply the styling to your application. Note that all styling is scoped with the employer-scope
class. We would have preferred leaving scoping up to the consuming application, but certain inflexibilites with Sass and some peculiar things this library is doing currently forbid this.
You may use any grid framework of your choosing. We have, however, built a Neat-based grid library intended for use with Employer. You can read integration instructions at employer-style-grid.
At the moment, only uncompiled Sass source files are available for consumption. That means your application will need to perform the precompilation, whether it be through Webpack, Gulp, Grunt, Rails asset pipeline, etc. Do note that employer-style-base
depends upon and includes Bourbon for basic Sass mixins.
The current layout of this library is heavily inspired by Bitters, a wonderful boilerplate of common-sense Sass conventions and structure. Our outline looks a little something like this:
dist/
├── ... >> Not yet used
sass/ >> The bulk of the styling itself
├── directives/ >> Useful mixins and functions to build a site with
│ ├── 00_variables/ >> Re-usable color and sizing variables
│ ├── 01_tools/ >> Globally used mixins and functions
│ ├── 02_base_components/ >> Small components that are typically used in larger components
│ ├── 03_components/ >> Large components and features; items that make use of 02_base_components
│ └── 04_utilities/ >> Helper classes and overrides
└── selectors/ >> Classes and element selectors which implement directives
Our projects prefer semantic (BEM) class names that are specific to their use and which use the directives created here, over classes that are reused. For that reason, contributions should typically be added as mixins.
Adding Classes - Reusable classes are primarily buttons, tooltips, and other commonly repeated elements. That said, do include a class or element counterpart to your directives in the selectors/
directory for use by 3rd party projects that do not consume the Sass files.
Do Not Add Extends - For predictability and performance, use mixins instead.
After adding a new directive to sass/directives/
, remember to @import
it into the _base.scss
file.
After your PR is merged, update the semantic version number appropriately, add a release and publish
via Yarn or npm.
Then update the package.json
file in your project with the new version:
"dependencies": {
"employer-style-base": "=2.2.1"
}
Employer Style Base includes a pattern library built with Fractal. The pattern library serves as a quick reference to the components that come with style base and how to use them.
If you haven't already, from within the employer-style-base repo run
yarn install
This will install Fractal and Fractal CLI.
In order to show styled components, you must first compile from .scss
to .css
. Run
yarn run dev
to both compile and watch the .scss
files. If you've already started the Fractal server you may need to restart it.
Now start the pattern library locally with
yarn run fractal
This will give you a URL where you can view the local copy of the pattern library and it will watch the files for changes.
After your changes are committed and merged, update the production build of the pattern library, then push the changes to the gh-pages
branch with the following commands:
fractal build
git subtree push --prefix build origin gh-pages
Fractal views are built using the Handlebars templating framework.
dist
for easy consumptionFAQs
A stack-agnostic Sass library providing basic components and typography intended for the Employer experience
The npm package employer-style-base receives a total of 42 weekly downloads. As such, employer-style-base popularity was classified as not popular.
We found that employer-style-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.