Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
fear-core-ui
Advanced tools
Core Sass, fonts and images for Marks and Spencer
The library exposes the following paths:
Install the module:
npm install fear-core-ui --save
Add the following to the gulp sass compile file.
var fearCoreUI = require('fear-core-ui');
.pipe(sass({
includePaths: fearCoreUI.sassPaths
})
);
The following variables need to be set
$fear-core-ui-font-dir: '/assets/fonts';
$fear-core-ui-images-dir: '/assets/images';
Copy fear-core-ui assets to your working directory
var fearCoreUI = require('fear-core-ui');
gulp.task('copy-fear-core-ui-assets', function() {
return gulp.src([fearCoreUI.assetPaths + '/**/*.*'])
.pipe(gulp.dest('/assets'));
});
Note that the variables set in step 3 should correspond to the location of the assets copied in step 4.
You can now reference any sass file.
@import 'fear-core-ui/base';
@import 'fear-core-ui/typography';
fear-core-ui/base
contains all the variables, functions and mixins in the library.
You can import this multiple times in your SASS code.
fear-core-ui/extends
contains all the extends rules.
This should be imported once and ONLY once per generated CSS file. If you import it more than once per generated CSS file you will have duplicate CSS rules.
We want to make sure that unnecessary CSS is not imported to consuming projects.
The following can be exposed through aggregate files:
Example:
@import utlities.scss;
@import 'utilities/functions';
@import 'utilities/mixins';
@import 'utilities/variables';
This can be done because the sass code in these files do not add CSS unless mixins / extends are explicitly called from the consuming code.
When a sass file contains direct CSS it needs to consumed through an explicit import.
i.e. If I only wanted to use the buttons.sass
component. Importing an aggregate components.sass
which included all the components CSS. That would create bloat and unused CSS being included in the consuming project.
Example: The buttons components contains direct CSS and must be imported through a direct import and not an aggregate sass file.
@import ui-pattern/buttons;
.btn--primary {
@include create-btn(40px, 15px, $color__brand--green, $color__brand--dark-grey, $color__brand--background-grey, $color__brand--light-grey);
}
.btn--secondary {
@include create-btn(40px, 15px, $color__brand--grey-40, $color__brand--dark-grey, $color__brand--background-grey, $color__brand--light-grey);
}
assets
|- fonts
|- images
sass
item.scss
- item // directory
|- _variables.scss
|- _extends.scss
|- _functions.scss
|- _mixins.scss
|- _module_itemA.scss
|- _module_itemB.scss
@import 'item/variables';
@import 'item/extends';
@import 'item/functions';
@import 'item/mixins';
@import 'item/module_itemA';
@import 'item/module_itemB';
|- layouts
|- _grid.scss
|- grid
|- _variables.scss
|- _mixins.scss
|- _module_grid.scss
|- _zindex.scss
|- normalize
|- _module_mns-normalize.scss
|- _module_normalize.scss
|- typography
|- ui-pattern
|- _buttons.scss
|- buttons
|- _mixins.scss
|- _module_icons.scss
|- _module_buttons.scss
|- utilites
|- _mixins_measurements.scss
_colors.scss
_sprites.scss
_normalize.scss
The mns-icons fonts are located in the lib/assets/fonts
directory. The font directory contains the generated mns-icon fonts:
In the mns-icons
folder you will find the settings file (selection.json
) used by icomoon and a demo project to serve up and test the fonts:
The following steps will guide you through the process of adding icons to the mns-icon font
lib/assets/fonts/mns-icons/selection.json
)Generate Font
demo.html
file in the demo-files folder.lib/assets/fonts
and the demo files to the mns-icons
folderlib/sass/fear-core-ui/ui-pattern/_extends_content.scss
and give it a proper sass variable namelib/sass/fear-core-ui/ui-pattern/_module_icons.scss
file:@include('css-class-name', 'icon-variable-name')
mns-icons
folder.npm test
runs eslint eslint tasks
and sass lint gulp lint-sass
###Further reading
FAQs
Marks and Spencer core UI sass, fonts, images and assets
The npm package fear-core-ui receives a total of 18 weekly downloads. As such, fear-core-ui popularity was classified as not popular.
We found that fear-core-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.