seed-visibility
v0.2.4
Published
Visibility utility pack for Seed
Downloads
1,626
Maintainers
Readme
seed-visibility
Visibility utility pack for Seed!
Install
npm install seed-visibility --save
Documentation
Check out our styleguide for documentation of this pack.
Visibility handling with display
For the display: none
/ display: block
based visibility techniques, check out seed-display
.
Basic Usage
CSS
Add the seed-visibility.css or seed-visibility.min.css to your project, and import it like so:
<link rel="stylesheet" href="/css/seed-visibility.css">
SCSS
This seed pack needs to be imported into your sass pipeline. Below is an example using Gulp:
var gulp = require('gulp');
var sass = require('gulp-sass');
var seedTypography = require('seed-visibility');
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass({
includePaths: seedTypography
}))
.pipe(gulp.dest('./css'));
});
Once that is setup, simply @import
seed-visibility as needed in your .scss
file:
// Packs
@import "pack/seed-visibility";
Note: Because seed-visibility has dependencies, its includePaths output will be an array
. If you're including other paths in addition to seed-visibility, you will need to flatten the array. An easy way to do this is to use sass-pathfinder.
Example with sass-pathfinder:
var gulp = require('gulp');
var sass = require('gulp-sass');
var seedTypography = require('seed-visibility');
var pathfinder = require('sass-pathfinder');
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass({
includePaths: pathfinder(
'./scss/vendor/example',
'./scss/plugins/super-awesome-plugin',
seedTypography
)
}))
.pipe(gulp.dest('./css'));
});
Options
The following variables can be found in _config.scss
$seed-visibility-invisible-namespace: u-invisible !default;
$seed-visibility-screen-reader-namespace: u-sr-only !default;
$seed-visibility-visible-namespace: u-visible !default;