Socket
Book a DemoInstallSign in
Socket

postcss-hide

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-hide

PostCSS plugin that adds shortcuts to hiding elements

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

postcss-hide Build Status

PostCSS plugin that adds shortcuts to hiding elements.

Installation

$ npm install postcss-hide --save-dev

Usage

all

Hide visually and from screen readers

.all {
  hide: all;
}
.all {
  display: none !important;
}

invisible

Hide visually and from screen readers, but maintain layout

.invisible {
  hide: invisible;
}
.invisible {
  visibility: hidden;
}

text

Image replacement, not widely used but present in Bootstrap.

.text-hide {
  hide: text;
}
.text-hide {
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}

visually

Hide visually but not from screenreaders

.visuallyhidden {
  hide: visually;
}
.visuallyhidden {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
}

focusable

Extends the visually declarations to allow the element to be focusable when navigated to via the keyboard

.visuallyhidden.focusable:focus,
.visuallyhidden.focusable:active {
  hide: focusable;
}
.visuallyhidden.focusable:focus,
.visuallyhidden.focusable:active {
  clip: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  position: static !important;
  width: auto !important;
}

Options

overrides

Overwrite the default styles using a configuration object

import postcss from 'postcss';
import hide from 'postcss-hide';

postcss.use(hide({
  overrides: {
    all: 'display: none; overflow: hidden;'
  }
}));

See PostCSS docs for examples for your environment.

Keywords

postcss

FAQs

Package last updated on 27 Jun 2015

Did you know?

Socket

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.

Install

Related posts