-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inline svg via data URIs and build out color modifier classes
- Loading branch information
Thomas Lowry
committed
Apr 23, 2020
1 parent
0990eab
commit 2f1a462
Showing
94 changed files
with
727 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,41 @@ | ||
(function () { | ||
'use strict'; | ||
'use strict'; | ||
|
||
const selector = 'disclosure'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const disclosureHandler = function (event) { | ||
let disclosureSet = this.parentNode.parentNode; | ||
let disclosuresInSet = disclosureSet.querySelectorAll('li'); | ||
let alreadyActive = this.parentNode.classList.contains(selector + '--expanded'); | ||
const selector = 'disclosure'; | ||
|
||
disclosuresInSet.forEach((disclosure) => { | ||
disclosure.classList.remove(selector + '--expanded'); | ||
}); | ||
const disclosureHandler = function (event) { | ||
let disclosureSet = this.parentNode.parentNode; | ||
let disclosuresInSet = disclosureSet.querySelectorAll('li'); | ||
let alreadyActive = this.parentNode.classList.contains(selector + '--expanded'); | ||
|
||
disclosuresInSet.forEach((disclosure) => { | ||
disclosure.classList.remove(selector + '--expanded'); | ||
}); | ||
|
||
this.parentNode.classList.add(selector + '--expanded'); | ||
this.parentNode.classList.add(selector + '--expanded'); | ||
|
||
if (alreadyActive) { | ||
this.parentNode.classList.remove(selector + '--expanded'); | ||
} | ||
}; | ||
if (alreadyActive) { | ||
this.parentNode.classList.remove(selector + '--expanded'); | ||
} | ||
}; | ||
|
||
const disclosure = { | ||
init: function () { | ||
let disclosures = document.querySelectorAll('.' + selector + '__label'); | ||
const disclosure = { | ||
init: function () { | ||
let disclosures = document.querySelectorAll('.' + selector + '__label'); | ||
|
||
disclosures.forEach((disclosure) => { | ||
disclosure.addEventListener('click', disclosureHandler, false); | ||
}); | ||
}, | ||
disclosures.forEach((disclosure) => { | ||
disclosure.addEventListener('click', disclosureHandler, false); | ||
}); | ||
}, | ||
|
||
destroy: function () { | ||
let disclosures = document.querySelectorAll('.' + selector + '__label'); | ||
destroy: function () { | ||
let disclosures = document.querySelectorAll('.' + selector + '__label'); | ||
|
||
disclosures.forEach((disclosure) => { | ||
disclosure.removeEventListener('click', disclosureHandler, false); | ||
}); | ||
} | ||
}; | ||
disclosures.forEach((disclosure) => { | ||
disclosure.removeEventListener('click', disclosureHandler, false); | ||
}); | ||
} | ||
}; | ||
|
||
// import css to be processed to css file | ||
disclosure.init(); | ||
})(); | ||
exports.disclosure = disclosure; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.