Skip to content

Commit

Permalink
Merge pull request #3 from dollarshaveclub/classname-syntax
Browse files Browse the repository at this point in the history
Changing the way class names are attached to the body
  • Loading branch information
PeterCadwell authored Sep 20, 2016
2 parents 63ec134 + 3b9ffbb commit a97b66a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build/test-interface.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/test.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ class Test {

// We've now bucketed our user
// Add classname
const className = `${name}--${bucket}`;
if (supportsClasslist) {
document.body.classList.add(name, bucket);
document.body.classList.add(className);
} else {
document.body.className += ` ${name} ${bucket}`;
document.body.className += ` ${className}`;
}

let info = {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ab-tester",
"version": "0.3.2",
"version": "0.4.0",
"homepage": "https://github.com/dollarshaveclub/ab-tester.js",
"main": "./index.js",
"repository": {
Expand Down Expand Up @@ -28,5 +28,8 @@
"sinon": "1.15.4",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
},
"dependencies": {
"babel-preset-es2015": "^6.14.0"
}
}

0 comments on commit a97b66a

Please sign in to comment.