Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Adding diff the build to assert that less and scss generated css are …
Browse files Browse the repository at this point in the history
…the same, ignoring previously accepted differences.
  • Loading branch information
dbatiste committed Jun 12, 2015
1 parent 2f7cae0 commit 3b170ae
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/
test/output
test/diff/less-scss-diff-new
offscreen.css
offscreen-less.css
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.csslintrc
node_modules
karma.conf.js
test
offscreen.css.less
offscreen.css.scss
offscreen-less.css
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# vui-offscreen
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]

The **vui-offscreen** library provides a Less mixin and CSS for positioning elements off the screen.
Off-screen elements are valuable from an accessibility perspective when you wish to have elements which are only visible to screen readers. For more information, read [WebAIM's article on Invisible Content](http://webaim.org/techniques/css/invisiblecontent/).

For further information on this component and other VUI components, see the docs at [ui.valence.d2l.com](http://ui.valence.d2l.com/).

#### Coding styles
See the [VUI Best Practices & Style Guide](https://github.com/Brightspace/valence-ui-docs/wiki/Best-Practices-&-Style-Guide) for information on VUI naming conventions, plus information about the [EditorConfig](http://editorconfig.org) rules used in this repo.

[npm-url]: https://npmjs.org/package/vui-offscreen
[npm-image]: https://img.shields.io/npm/v/vui-offscreen.svg
[ci-image]: https://travis-ci.org/Brightspace/valence-ui-offscreen.svg?branch=master
[ci-url]: https://travis-ci.org/Brightspace/valence-ui-offscreen
# vui-offscreen
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![Dependency Status][dependencies-image]][dependencies-url]

This component contains Sass mixins and CSS for positioning elements off the screen. LESS mixins are still include for backward compatibility, however these will likely be removed in a future version.

Off-screen elements are valuable from an accessibility perspective when you wish to have elements which are only visible to screen readers. For more information, read [WebAIM's article on Invisible Content](http://webaim.org/techniques/css/invisiblecontent/).

For further information on this component and other VUI components, see the docs at [ui.valence.d2l.com](http://ui.valence.d2l.com/).

#### Coding styles
See the [VUI Best Practices & Style Guide](https://github.com/Brightspace/valence-ui-docs/wiki/Best-Practices-&-Style-Guide) for information on VUI naming conventions, plus information about the [EditorConfig](http://editorconfig.org) rules used in this repo.

[npm-url]: https://npmjs.org/package/vui-offscreen
[npm-image]: https://img.shields.io/npm/v/vui-offscreen.svg
[ci-image]: https://travis-ci.org/Brightspace/valence-ui-offscreen.svg?branch=master
[ci-url]: https://travis-ci.org/Brightspace/valence-ui-offscreen
[dependencies-url]: https://david-dm.org/brightspace/valence-ui-offscreen
[dependencies-image]: https://img.shields.io/david/Brightspace/valence-ui-offscreen.svg
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vui-offscreen",
"version": "0.1.0",
"version": "0.1.1",
"description": "Mixins and CSS for positioning elements offscreen",
"scripts": {
"clean": "rimraf *.css",
Expand All @@ -9,7 +9,12 @@
"build:less:css": "lessc offscreen.css.less > offscreen-less.css",
"postbuild:less:css": "csslint offscreen-less.css",
"build:sass:css": "node-sass --output-style expanded offscreen.css.scss offscreen.css",
"postbuild:sass:css": "csslint offscreen.css"
"postbuild:sass:css": "csslint offscreen.css",
"pretest": "npm run build",
"test": "npm run diff:assert",
"prediff:assert": "npm run diff:create",
"diff:assert": "assertnodiff --file1 ./test/diff/less-scss-diff --file2 ./test/diff/less-scss-diff-new",
"diff:create": "createpatch --file1 offscreen-less.css --file2 offscreen.css -o ./test/diff/less-scss-diff-new"
},
"repository": {
"type": "git",
Expand All @@ -28,6 +33,7 @@
"homepage": "https://github.com/Brightspace/valence-ui-offscreen",
"devDependencies": {
"csslint": "^0.10.0",
"diff-cli": "git://github.com/Brightspace/diff-cli.git#v0.0.1",
"less": "^2.5.1",
"node-sass": "^3.1.1",
"rimraf": "^2.3.4"
Expand Down
13 changes: 13 additions & 0 deletions test/diff/less-scss-diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
===================================================================
--- offscreen-less.css
+++ offscreen.css
@@ -4,8 +4,9 @@
overflow: hidden;
width: 1px;
height: 1px;
}
+
[dir="rtl"] .vui-offscreen {
left: auto;
right: -10000px;
}

0 comments on commit 3b170ae

Please sign in to comment.