Reorganize styleguide (pattern library) to distinguish static layouts, styleguide from Sass powering it

This commit is contained in:
benjamin melançon 2018-08-20 09:42:55 -04:00
parent b9040a7fde
commit 952af16725
235 changed files with 4 additions and 4 deletions

View file

@ -0,0 +1,26 @@
(function (window, document) {
'use strict';
var KssGuides = function (config) {
this.bodyClass = config.bodyClass || 'kss-guides-mode';
this.init();
};
KssGuides.prototype.init = function () {
var self = this;
// Initialize all guides toggle buttons.
document.querySelectorAll('a[data-kss-guides]').forEach(function (el) {
el.onclick = self.showGuides.bind(self);
});
};
// Toggle the guides mode.
KssGuides.prototype.showGuides = function () {
document.getElementsByTagName('body')[0].classList.toggle(this.bodyClass);
};
// Export to DOM global space.
window.KssGuides = KssGuides;
})(window, document);