Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bb1c297b3 | |||
| 3514094043 | |||
| b6cc236ced | |||
| f78b0a4c63 | |||
| 7bcb45d9bc | |||
| 05fbea8dfd | |||
| e0d62ccc4f | |||
| 2941a5903f | |||
| 857680c3b1 | |||
| b44b17d830 | |||
| 8fe6e39440 | |||
| 5f050066e9 | |||
| 0b5e54faa6 | |||
| 6d8b9d0e47 | |||
| 9db11f3f97 | |||
| df95905fe0 | |||
| 89870edaaf | |||
| ca3f9970a9 | |||
| d5cbcb5807 | |||
| a204f7fc98 |
@@ -100,4 +100,4 @@ You will now be able to include the .pp file in your pattern's index file while
|
|||||||
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
This framework includes [PrismJS](https://prismjs.com/) for code syntax highlighting. PrismJS is released under the [MIT license](https://opensource.org/licenses/MIT)>
|
This framework includes [PrismJS](https://prismjs.com/) for code syntax highlighting. PrismJS is released under the [MIT license](https://opensource.org/licenses/MIT).
|
||||||
|
|||||||
@@ -354,17 +354,6 @@
|
|||||||
"keep_fnames": false,
|
"keep_fnames": false,
|
||||||
"safari10": false
|
"safari10": false
|
||||||
},
|
},
|
||||||
"node-sass": {
|
|
||||||
"indentType": "space",
|
|
||||||
"allowWildcardImports": false,
|
|
||||||
"indentWidth": 2,
|
|
||||||
"linefeed": "lf",
|
|
||||||
"outputStyle": "expanded",
|
|
||||||
"precision": 10,
|
|
||||||
"sourceMap": false,
|
|
||||||
"removeCharset": false,
|
|
||||||
"sourceComments": false
|
|
||||||
},
|
|
||||||
"png": {
|
"png": {
|
||||||
"quality": 90
|
"quality": 90
|
||||||
},
|
},
|
||||||
@@ -442,6 +431,17 @@
|
|||||||
"turf": {
|
"turf": {
|
||||||
"rootDir": ""
|
"rootDir": ""
|
||||||
},
|
},
|
||||||
|
"node-sass": {
|
||||||
|
"indentType": "space",
|
||||||
|
"allowWildcardImports": false,
|
||||||
|
"indentWidth": 2,
|
||||||
|
"linefeed": "lf",
|
||||||
|
"outputStyle": "expanded",
|
||||||
|
"precision": 10,
|
||||||
|
"sourceMap": false,
|
||||||
|
"removeCharset": false,
|
||||||
|
"sourceComments": false
|
||||||
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
@@ -1372,6 +1372,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"file": "src/pg/patterns/core/header/_header.pp",
|
||||||
|
"config": {
|
||||||
|
"autoCompile": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pg/patterns/core/sticky-note/_sticky-note.pp",
|
"file": "src/pg/patterns/core/sticky-note/_sticky-note.pp",
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
245
public/assets/scaffolding-min.js
vendored
245
public/assets/scaffolding-min.js
vendored
@@ -3014,13 +3014,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 8 */
|
/* 8 */
|
||||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
"use strict";
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ init: function() { return /* binding */ init; }
|
|
||||||
/* harmony export */ });
|
|
||||||
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
||||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
||||||
@@ -3122,35 +3117,37 @@ var calculateStickyPosition = function calculateStickyPosition(s) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function init() {
|
module.exports = {
|
||||||
var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
init: function init() {
|
||||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px", ""));
|
var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
||||||
p.querySelectorAll("sticky-note").forEach(function (s) {
|
|
||||||
if (s.querySelectorAll("svg").length == 0) {
|
|
||||||
var wrapper = document.createElement("sticky-note-wrapper");
|
|
||||||
s.parentNode.insertBefore(wrapper, s);
|
|
||||||
wrapper.appendChild(s);
|
|
||||||
s.setAttribute("content", s.innerHTML.replace(/"/g, "\""));
|
|
||||||
s.innerHTML = "<div><svg width='0' height='0'><defs><clipPath id='stickyClip' clipPathUnits='objectBoundingBox'><path d='M 0 0 Q 0 0.69, 0.03 0.96 0.03 0.96, 1 0.96 Q 0.96 0.69, 0.96 0 0.96 0, 0 0' stroke-linejoin='round' stroke-linecap='square' /></clipPath></defs></svg></div><div><div>".concat(s.innerHTML, "</div></div>");
|
|
||||||
}
|
|
||||||
calculateStickyPosition(s);
|
|
||||||
drag(s);
|
|
||||||
s.ondblclick = function (e) {
|
|
||||||
if (e.ctrlKey) {
|
|
||||||
calculateStickyPosition(s);
|
|
||||||
} else {
|
|
||||||
// add one click select
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
window.onresize = function () {
|
|
||||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px", ""));
|
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px", ""));
|
||||||
var stickies = p.querySelectorAll("sticky-note");
|
p.querySelectorAll("sticky-note").forEach(function (s) {
|
||||||
stickies.forEach(function (s) {
|
if (s.querySelectorAll("svg").length == 0) {
|
||||||
|
var wrapper = document.createElement("sticky-note-wrapper");
|
||||||
|
s.parentNode.insertBefore(wrapper, s);
|
||||||
|
wrapper.appendChild(s);
|
||||||
|
s.setAttribute("content", s.innerHTML.replace(/"/g, "\""));
|
||||||
|
s.innerHTML = "<div><svg width='0' height='0'><defs><clipPath id='stickyClip' clipPathUnits='objectBoundingBox'><path d='M 0 0 Q 0 0.69, 0.03 0.96 0.03 0.96, 1 0.96 Q 0.96 0.69, 0.96 0 0.96 0, 0 0' stroke-linejoin='round' stroke-linecap='square' /></clipPath></defs></svg></div><div><div>".concat(s.innerHTML, "</div></div>");
|
||||||
|
}
|
||||||
calculateStickyPosition(s);
|
calculateStickyPosition(s);
|
||||||
|
drag(s);
|
||||||
|
s.ondblclick = function (e) {
|
||||||
|
if (e.ctrlKey) {
|
||||||
|
calculateStickyPosition(s);
|
||||||
|
} else {
|
||||||
|
// add one click select
|
||||||
|
}
|
||||||
|
};
|
||||||
});
|
});
|
||||||
};
|
window.onresize = function () {
|
||||||
}
|
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px", ""));
|
||||||
|
var stickies = p.querySelectorAll("sticky-note");
|
||||||
|
stickies.forEach(function (s) {
|
||||||
|
calculateStickyPosition(s);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 9 */
|
/* 9 */
|
||||||
@@ -3190,13 +3187,8 @@ module.exports = {
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 10 */
|
/* 10 */
|
||||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
"use strict";
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ init: function() { return /* binding */ init; }
|
|
||||||
/* harmony export */ });
|
|
||||||
/* DS2 core (c) 2024 Alexander McIlwraith
|
/* DS2 core (c) 2024 Alexander McIlwraith
|
||||||
Released under Creative Commons Attribution-ShareAlike 4.0 International
|
Released under Creative Commons Attribution-ShareAlike 4.0 International
|
||||||
*/
|
*/
|
||||||
@@ -3226,75 +3218,114 @@ var waitForElement = function waitForElement(selector) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
function init() {
|
var chooseTab = function chooseTab(tab) {
|
||||||
var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
var siblings = Array.from(tab.parentNode.children);
|
||||||
var spacer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
siblings.forEach(function (sibling) {
|
||||||
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
return sibling.classList.remove("selected");
|
||||||
container.querySelectorAll(".tab-group, tabset").forEach(function (tabGroup) {
|
|
||||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
|
||||||
var tabgroup = tabGroup.getAttribute("id");
|
|
||||||
var tablist = "";
|
|
||||||
Array.from(tabGroup.children).forEach(function (child) {
|
|
||||||
var tab = child.getAttribute("tab") || child.getAttribute("data-tab");
|
|
||||||
if (tab !== null) {
|
|
||||||
var tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
|
||||||
var tabPanel = document.createElement('div');
|
|
||||||
tabPanel.id = "tab-panel-".concat(tabgroup, "-").concat(tabID);
|
|
||||||
tabPanel.className = tablist === "" ? "open" : "";
|
|
||||||
tabPanel.setAttribute("role", "tabpanel");
|
|
||||||
tabPanel.setAttribute("tabindex", "0");
|
|
||||||
tabPanel.setAttribute("aria-labelledby", "tab-".concat(tabgroup, "-").concat(tabID));
|
|
||||||
tabPanel.appendChild(child.cloneNode(true));
|
|
||||||
child.parentNode.replaceChild(tabPanel, child);
|
|
||||||
tablist += "<li tabindex=\"0\" role=\"tab\" ".concat(tablist === "" ? "class='selected'" : "", " id=\"tab-").concat(tabgroup, "-").concat(tabID, "\"><span>").concat(tab, "</span></li>");
|
|
||||||
} else {
|
|
||||||
child.classList.add("tab-hidden");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var ul = document.createElement('ul');
|
|
||||||
ul.setAttribute("role", "tablist");
|
|
||||||
ul.innerHTML = spacer != true ? "".concat(tablist) : "".concat(tablist, "<li role=\"separator\" class=\"separator\"></li>");
|
|
||||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
|
||||||
tabGroup.querySelectorAll('[role="tab"]').forEach(function (tab) {
|
|
||||||
tab.addEventListener("click", function (e) {
|
|
||||||
if (e.altKey && typeof args.altModifier == "function") {
|
|
||||||
args.altModifier(tab);
|
|
||||||
} else if (e.shiftKey && typeof args.shiftModifier == "function") {
|
|
||||||
args.shiftModifier(tab);
|
|
||||||
} else if (e.metaKey && typeof args.metaModifier == "function") {
|
|
||||||
args.metaModifier(tab);
|
|
||||||
} else {
|
|
||||||
var siblings = Array.from(tab.parentNode.children);
|
|
||||||
siblings.forEach(function (sibling) {
|
|
||||||
return sibling.classList.remove("selected");
|
|
||||||
});
|
|
||||||
tab.classList.add("selected");
|
|
||||||
var tabPanels = Array.from(tab.parentNode.parentNode.children).filter(function (child) {
|
|
||||||
return child.getAttribute("role") === "tabpanel";
|
|
||||||
});
|
|
||||||
tabPanels.forEach(function (panel) {
|
|
||||||
return panel.classList.remove("open");
|
|
||||||
});
|
|
||||||
var tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
|
||||||
document.getElementById(tabPanelId).classList.add("open");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tab.addEventListener("keypress", function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (e.which == 32 || e.which == 13) {
|
|
||||||
e.currentTarget.dispatchEvent(click);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (document.location.hash != "" && document.location.hash.substring(0, 5) == "#tab-") {
|
|
||||||
waitForElement(document.location.hash).then(function (el) {
|
|
||||||
el.scrollIntoView();
|
|
||||||
el.dispatchEvent(click);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
tab.classList.add("selected");
|
||||||
|
var tabPanels = Array.from(tab.parentNode.parentNode.children);
|
||||||
|
tabPanels.forEach(function (panel) {
|
||||||
|
return panel.classList.remove("open");
|
||||||
|
});
|
||||||
|
var tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||||
|
document.getElementById(tabPanelId).classList.add("open");
|
||||||
|
};
|
||||||
|
var pushState = 0;
|
||||||
|
var tabsetCount = 0;
|
||||||
|
module.exports = {
|
||||||
|
"init": function init() {
|
||||||
|
var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
||||||
|
var spacer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||||
|
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||||
|
container.querySelectorAll(".tab-group, tabset").forEach(function (tabGroup) {
|
||||||
|
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||||
|
if (tabGroup.getAttribute("id") == null) {
|
||||||
|
tabGroup.setAttribute("id", "tab-group-" + tabsetCount);
|
||||||
|
tabsetCount++;
|
||||||
|
}
|
||||||
|
var tabgroup = tabGroup.getAttribute("id");
|
||||||
|
var tablist = "";
|
||||||
|
Array.from(tabGroup.children).forEach(function (child) {
|
||||||
|
// is details?
|
||||||
|
var dtls = child.nodeName == "DETAILS" ? true : false;
|
||||||
|
|
||||||
|
// get the tab text
|
||||||
|
var tab = dtls ? child.querySelector("summary").innerHTML : child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||||
|
|
||||||
|
// if the tab text is not blank
|
||||||
|
if (tab !== null) {
|
||||||
|
var tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
||||||
|
|
||||||
|
// define the tab panel content
|
||||||
|
var tabPanel = null;
|
||||||
|
if (dtls) {
|
||||||
|
tabPanel = child;
|
||||||
|
tabPanel.setAttribute("open", "");
|
||||||
|
} else {
|
||||||
|
tabPanel = document.createElement('div');
|
||||||
|
tabPanel.appendChild(child.cloneNode(true));
|
||||||
|
}
|
||||||
|
tabPanel.id = "tab-panel-".concat(tabgroup, "-").concat(tabID);
|
||||||
|
tabPanel.className = tablist === "" ? "open" : "";
|
||||||
|
tabPanel.setAttribute("role", "tabpanel");
|
||||||
|
tabPanel.setAttribute("tabindex", "0");
|
||||||
|
tabPanel.setAttribute("aria-labelledby", "tab-".concat(tabgroup, "-").concat(tabID));
|
||||||
|
child.parentNode.replaceChild(tabPanel, child);
|
||||||
|
var cls = tablist === "" ? "class='selected'" : "";
|
||||||
|
tablist += "<li tabindex=\"0\" role=\"tab\" ".concat(cls, " id=\"tab-").concat(tabgroup, "-").concat(tabID, "\"><span>").concat(tab, "</span></li>");
|
||||||
|
} else {
|
||||||
|
child.classList.add("tab-hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var ul = document.createElement('ul');
|
||||||
|
ul.setAttribute("role", "tablist");
|
||||||
|
ul.innerHTML = spacer != true ? "".concat(tablist) : "".concat(tablist, "<li role=\"separator\" class=\"separator\"></li>");
|
||||||
|
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||||
|
tabGroup.querySelectorAll('[role="tab"]').forEach(function (tab) {
|
||||||
|
tab.addEventListener("click", function (evt) {
|
||||||
|
if (pushState == 0) {
|
||||||
|
window.history.pushState({
|
||||||
|
rand: Math.random(),
|
||||||
|
pushState: pushState,
|
||||||
|
tab: tab.parentNode.firstChild.getAttribute("id")
|
||||||
|
}, "", "#".concat(tab.parentNode.firstChild.getAttribute("id")));
|
||||||
|
pushState++;
|
||||||
|
}
|
||||||
|
chooseTab(evt.currentTarget);
|
||||||
|
window.history.pushState({
|
||||||
|
rand: Math.random(),
|
||||||
|
pushState: pushState,
|
||||||
|
tab: tab.getAttribute("id")
|
||||||
|
}, "", "#".concat(tab.getAttribute("id")));
|
||||||
|
pushState++;
|
||||||
|
});
|
||||||
|
tab.addEventListener("keypress", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (e.which == 32 || e.which == 13) {
|
||||||
|
e.currentTarget.dispatchEvent(click);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (document.location.hash != "" && document.location.hash.substring(0, 5) == "#tab-") {
|
||||||
|
waitForElement(document.location.hash).then(function (el) {
|
||||||
|
el.scrollIntoView();
|
||||||
|
el.focus();
|
||||||
|
el.dispatchEvent(click);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.addEventListener("popstate", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (e.state != null) {
|
||||||
|
chooseTab(document.querySelector("#".concat(e.state.tab)));
|
||||||
|
} else {
|
||||||
|
history.go(-1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
/******/ ]);
|
/******/ ]);
|
||||||
@@ -3397,9 +3428,11 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony import */ var _node_modules_prismjs_components_prism_sass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
|
/* harmony import */ var _node_modules_prismjs_components_prism_sass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
|
||||||
/* harmony import */ var _node_modules_prismjs_components_prism_sass__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_node_modules_prismjs_components_prism_sass__WEBPACK_IMPORTED_MODULE_6__);
|
/* harmony import */ var _node_modules_prismjs_components_prism_sass__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_node_modules_prismjs_components_prism_sass__WEBPACK_IMPORTED_MODULE_6__);
|
||||||
/* harmony import */ var _pg_patterns_core_sticky_note_sticky_note_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8);
|
/* harmony import */ var _pg_patterns_core_sticky_note_sticky_note_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8);
|
||||||
|
/* harmony import */ var _pg_patterns_core_sticky_note_sticky_note_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_pg_patterns_core_sticky_note_sticky_note_js__WEBPACK_IMPORTED_MODULE_7__);
|
||||||
/* harmony import */ var _pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9);
|
/* harmony import */ var _pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9);
|
||||||
/* harmony import */ var _pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8__);
|
/* harmony import */ var _pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8__);
|
||||||
/* harmony import */ var _pg_patterns_core_tabs_tabs_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10);
|
/* harmony import */ var _pg_patterns_core_tabs_tabs_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10);
|
||||||
|
/* harmony import */ var _pg_patterns_core_tabs_tabs_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_pg_patterns_core_tabs_tabs_js__WEBPACK_IMPORTED_MODULE_9__);
|
||||||
// core and prism
|
// core and prism
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -24,7 +24,7 @@
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$allowed_types = ["scss", "js"];
|
$allowed_types = ['js','pug','scss'];
|
||||||
$patterns = dirname(dirname(__file__)) . "/src/pg/patterns";
|
$patterns = dirname(dirname(__file__)) . "/src/pg/patterns";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<header>
|
<header>
|
||||||
<!-- The headline banner area -->
|
<!-- The headline banner area -->
|
||||||
<svg height="5.5rem" width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg style="height: 5.5rem; width: 100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<text>DS2 core</text>
|
<text>DS2 core</text>
|
||||||
</svg>
|
</svg>
|
||||||
<div>
|
<div>
|
||||||
@@ -76,8 +76,8 @@
|
|||||||
<h1 class="status-complete"><span>Header
|
<h1 class="status-complete"><span>Header
|
||||||
<tool-tip role="tooltip" inert="inert" tip-position="right">Complete</tool-tip></span></h1>
|
<tool-tip role="tooltip" inert="inert" tip-position="right">Complete</tool-tip></span></h1>
|
||||||
</article>
|
</article>
|
||||||
<article id="layouts-breakpoints" data-name="breakpoints" data-status="complete" data-template="pug" data-core="true" data-path="layouts/breakpoints" style="height: 100vh">
|
<article id="layouts-breakpoint" data-name="breakpoint" data-status="complete" data-template="pug" data-core="true" data-path="layouts/breakpoint" style="height: 100vh">
|
||||||
<h1 class="status-complete"><span>Breakpoints
|
<h1 class="status-complete"><span>Breakpoint
|
||||||
<tool-tip role="tooltip" inert="inert" tip-position="right">Complete</tool-tip></span></h1>
|
<tool-tip role="tooltip" inert="inert" tip-position="right">Complete</tool-tip></span></h1>
|
||||||
</article>
|
</article>
|
||||||
<article id="layouts-tabs" data-name="tabs" data-status="complete" data-template="pug" data-core="true" data-path="layouts/tabs" style="height: 100vh">
|
<article id="layouts-tabs" data-name="tabs" data-status="complete" data-template="pug" data-core="true" data-path="layouts/tabs" style="height: 100vh">
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<h2>What is it</h2>
|
<h2>What is it</h2>
|
||||||
@@ -14,8 +21,8 @@
|
|||||||
<p>When using this, use the default break points as they are set to the same as the Bootstrap framework. The grid for the design system at large break point has been widened to accompdate 3 colour cards across. </p>
|
<p>When using this, use the default break points as they are set to the same as the Bootstrap framework. The grid for the design system at large break point has been widened to accompdate 3 colour cards across. </p>
|
||||||
<tabset id="breakpoints">
|
<tabset id="breakpoints">
|
||||||
<div tab="scss">
|
<div tab="scss">
|
||||||
<pre class="language-sass">@import "[path-to]/breakpoints";
|
<pre class="language-sass">@use "scss/core/breakpoint/breakpoint";
|
||||||
@include break([breakpoint]) {
|
@include breapoint.break([breakpoint]) {
|
||||||
// css here
|
// css here
|
||||||
}</pre>
|
}</pre>
|
||||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||||
@@ -24,12 +31,13 @@
|
|||||||
// default breakpoints match bootstrap 5 breakpoints.
|
// default breakpoints match bootstrap 5 breakpoints.
|
||||||
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px ) !default;
|
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px ) !default;
|
||||||
|
|
||||||
@mixin breakpoint-debug {
|
@mixin debug {
|
||||||
body::before, body::after {
|
body::before, body::after {
|
||||||
background-color: #555;
|
background-color: #555;
|
||||||
color: white;
|
color: white;
|
||||||
content: "bigger than extra large";
|
content: "bigger than extra large";
|
||||||
display: grid;
|
display: grid;
|
||||||
|
font-family: sans-serif;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
grid-template-columns: auto;
|
grid-template-columns: auto;
|
||||||
padding: 25px;
|
padding: 25px;
|
||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<h2>What is it</h2>
|
<h2>What is it</h2>
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<h2>What is it</h2>
|
<h2>What is it</h2>
|
||||||
@@ -15,7 +22,7 @@
|
|||||||
<!-- create temp variables and store the design system values-->
|
<!-- create temp variables and store the design system values-->
|
||||||
<header>
|
<header>
|
||||||
<!-- The headline banner area -->
|
<!-- The headline banner area -->
|
||||||
<svg height="5.5rem" width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg style="height: 5.5rem; width: 100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<text>[site name]</text>
|
<text>[site name]</text>
|
||||||
</svg>
|
</svg>
|
||||||
<div>
|
<div>
|
||||||
@@ -34,7 +41,7 @@
|
|||||||
|
|
||||||
header
|
header
|
||||||
// The headline banner area
|
// The headline banner area
|
||||||
svg(height='5.5rem' width='100%' xmlns='http://www.w3.org/2000/svg' aria-hidden='true')
|
svg(style="height: 5.5rem; width: 100%" xmlns='http://www.w3.org/2000/svg' aria-hidden='true')
|
||||||
text= site
|
text= site
|
||||||
div
|
div
|
||||||
div.header-title
|
div.header-title
|
||||||
@@ -44,7 +51,7 @@ header
|
|||||||
</pre>
|
</pre>
|
||||||
<pre class="language-css" tab="css">header{display:-ms-grid;display:grid;-ms-grid-rows:1.75rem 3.5rem;grid-template-rows:1.75rem 3.5rem;-ms-grid-column:2;-ms-grid-column-span:2;grid-column:2/4;overflow:hidden}header svg{grid-column:1/-1;grid-row:1/-1;-ms-grid-row-align:stretch;-ms-grid-column-align:stretch;place-self:stretch}header svg text{-webkit-transform:translate(-1rem,7.25rem);-ms-transform:translate(-1rem,7.25rem);transform:translate(-1rem,7.25rem);font-size:10rem;font-weight:1000;font-family:sans-serif;fill:var(--colour-grey-xxl)}header>div{-ms-grid-row:2;grid-row:2;grid-column:1/-1;display:-ms-grid;display:grid;grid-column-gap:1rem;-ms-grid-columns:auto -webkit-max-content -webkit-max-content;-ms-grid-columns:auto max-content max-content;grid-template-columns:auto -webkit-max-content -webkit-max-content;grid-template-columns:auto max-content max-content}header>div .header-title h1{margin:0;padding:0 1rem}header>div .header-title h1 a,header>div .header-title h1 a:visited{border-bottom:none;color:var(--colour-black);font-family:sans-serif;font-size:2.5rem;font-size:32px;font-weight:700;margin:0;padding:0;text-decoration:none}</pre>
|
<pre class="language-css" tab="css">header{display:-ms-grid;display:grid;-ms-grid-rows:1.75rem 3.5rem;grid-template-rows:1.75rem 3.5rem;-ms-grid-column:2;-ms-grid-column-span:2;grid-column:2/4;overflow:hidden}header svg{grid-column:1/-1;grid-row:1/-1;-ms-grid-row-align:stretch;-ms-grid-column-align:stretch;place-self:stretch}header svg text{-webkit-transform:translate(-1rem,7.25rem);-ms-transform:translate(-1rem,7.25rem);transform:translate(-1rem,7.25rem);font-size:10rem;font-weight:1000;font-family:sans-serif;fill:var(--colour-grey-xxl)}header>div{-ms-grid-row:2;grid-row:2;grid-column:1/-1;display:-ms-grid;display:grid;grid-column-gap:1rem;-ms-grid-columns:auto -webkit-max-content -webkit-max-content;-ms-grid-columns:auto max-content max-content;grid-template-columns:auto -webkit-max-content -webkit-max-content;grid-template-columns:auto max-content max-content}header>div .header-title h1{margin:0;padding:0 1rem}header>div .header-title h1 a,header>div .header-title h1 a:visited{border-bottom:none;color:var(--colour-black);font-family:sans-serif;font-size:2.5rem;font-size:32px;font-weight:700;margin:0;padding:0;text-decoration:none}</pre>
|
||||||
<div class="language-sass" tab="scss">
|
<div class="language-sass" tab="scss">
|
||||||
<pre class="language-sass">@import "scss/core/header/header;
|
<pre class="language-sass">@use "scss/core/header/header;
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||||
//- Licensed under CC BY-SA 4.0
|
//- Licensed under CC BY-SA 4.0
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<div class="tab-group" id="status-report">
|
<div class="tab-group" id="status-report">
|
||||||
@@ -52,7 +59,7 @@
|
|||||||
<td><span class="status-complete">Complete</span></td>
|
<td><span class="status-complete">Complete</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="./?p=layouts/breakpoints"> Breakpoints</a></td>
|
<td><a href="./?p=layouts/breakpoint"> Breakpoint</a></td>
|
||||||
<td><span class="status-complete">Complete</span></td>
|
<td><span class="status-complete">Complete</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -83,7 +90,7 @@
|
|||||||
<td colspan="2"><span class="status-complete">Complete (10)</span></td>
|
<td colspan="2"><span class="status-complete">Complete (10)</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <a href="./?p=layouts/breakpoints">Breakpoints</a></td>
|
<td> <a href="./?p=layouts/breakpoint">Breakpoint</a></td>
|
||||||
<td>Layouts</td>
|
<td>Layouts</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -136,7 +143,7 @@
|
|||||||
<table role="presentation">
|
<table role="presentation">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <a href="./?p=layouts/breakpoints">Breakpoints</a></td>
|
<td> <a href="./?p=layouts/breakpoint">Breakpoint</a></td>
|
||||||
<td><span><span class="status-complete">Complete</span></span></td>
|
<td><span><span class="status-complete">Complete</span></span></td>
|
||||||
<td>Layouts</td>
|
<td>Layouts</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<h2>What is it</h2>
|
<h2>What is it</h2>
|
||||||
@@ -22,7 +29,7 @@
|
|||||||
<pre class="language-css" data-tab="css"> @import url("https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap");sticky-note-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid transparent;border-radius:50%;display:inline-block;height:0.5rem;position:relative;width:0.5rem}sticky-note-wrapper *{-webkit-box-sizing:border-box;box-sizing:border-box}sticky-note-wrapper sticky-note{cursor:-webkit-grab;cursor:grab;display:-ms-grid;display:grid;float:left;font-size:1rem;height:13rem;left:0;place-items:stretch;position:absolute;top:0;width:13rem;z-index:100}sticky-note-wrapper sticky-note:active{cursor:-webkit-grabbing;cursor:grabbing;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}sticky-note-wrapper sticky-note.right{float:right}sticky-note-wrapper sticky-note>div{-ms-grid-row:1;grid-row:1;-ms-grid-column:1;grid-column:1}sticky-note-wrapper sticky-note>div:first-child{background-color:rgba(0,0,0,0.25);-webkit-box-shadow:-2px 2px 15px 0 rgba(0,0,0,0.5);box-shadow:-2px 2px 15px 0 rgba(0,0,0,0.5);display:-ms-grid;display:grid;margin:2rem 1rem 0.25rem 0.36rem;width:calc(100% - 1rem)}sticky-note-wrapper sticky-note>div:nth-child(2){clip-path:url(#stickyClip);display:-ms-grid;display:grid;font-family:"Kalam",cursive;font-style:1rem;font-weight:300;line-height:1.25rem;padding:1rem;place-items:center;text-align:center}sticky-note-wrapper sticky-note>div:nth-child(2)>*{font-family:"Kalam",cursive!important;font-style:normal!important;font-weight:300!important}@media screen and (max-width:1024px){sticky-note-wrapper sticky-note>div:nth-child(2){max-width:13rem;min-width:13rem;width:1rem}}@media screen and (max-width:768px){sticky-note-wrapper sticky-note>div:nth-child(2){font-size:1.75rem;max-width:21rem;min-height:21rem}}@media screen and (max-width:640px){sticky-note-wrapper sticky-note>div:nth-child(2){font-size:2.5rem;max-width:26rem;min-height:26rem}}sticky-note-wrapper sticky-note>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#ffffdd),color-stop(2%,#ffffd3),color-stop(12%,#ffffd3),color-stop(75%,#ffffc9),to(#ffffba));background:linear-gradient(180deg,#ffffdd 0%,#ffffd3 2%,#ffffd3 12%,#ffffc9 75%,#ffffba 100%)}sticky-note-wrapper sticky-note.blue>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#9dddec),color-stop(2%,#94daea),color-stop(12%,#94daea),color-stop(75%,#8bd7e8),to(#7fd3e6));background:linear-gradient(180deg,#9dddec 0%,#94daea 2%,#94daea 12%,#8bd7e8 75%,#7fd3e6 100%)}sticky-note-wrapper sticky-note.pink>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#fa7c93),color-stop(2%,#fa728b),color-stop(12%,#fa728b),color-stop(75%,#fa6883),to(#f95977));background:linear-gradient(180deg,#fa7c93 0%,#fa728b 2%,#fa728b 12%,#fa6883 75%,#f95977 100%)}sticky-note-wrapper sticky-note.green>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#c5fcc9),color-stop(2%,#bbfbc0),color-stop(12%,#bbfbc0),color-stop(75%,#b1fab7),to(#a3faaa));background:linear-gradient(180deg,#c5fcc9 0%,#bbfbc0 2%,#bbfbc0 12%,#b1fab7 75%,#a3faaa 100%)}sticky-note-wrapper:has(sticky-note:hover){background-color:#ffffd3;border:1px solid black}sticky-note-wrapper:has(sticky-note.yellow:hover){background-color:#ffffd3}sticky-note-wrapper:has(sticky-note.blue:hover){background-color:#94daea}sticky-note-wrapper:has(sticky-note.pink:hover){background-color:#fa728b}sticky-note-wrapper:has(sticky-note.green:hover){background-color:#bbfbc0}</pre>
|
<pre class="language-css" data-tab="css"> @import url("https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap");sticky-note-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid transparent;border-radius:50%;display:inline-block;height:0.5rem;position:relative;width:0.5rem}sticky-note-wrapper *{-webkit-box-sizing:border-box;box-sizing:border-box}sticky-note-wrapper sticky-note{cursor:-webkit-grab;cursor:grab;display:-ms-grid;display:grid;float:left;font-size:1rem;height:13rem;left:0;place-items:stretch;position:absolute;top:0;width:13rem;z-index:100}sticky-note-wrapper sticky-note:active{cursor:-webkit-grabbing;cursor:grabbing;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}sticky-note-wrapper sticky-note.right{float:right}sticky-note-wrapper sticky-note>div{-ms-grid-row:1;grid-row:1;-ms-grid-column:1;grid-column:1}sticky-note-wrapper sticky-note>div:first-child{background-color:rgba(0,0,0,0.25);-webkit-box-shadow:-2px 2px 15px 0 rgba(0,0,0,0.5);box-shadow:-2px 2px 15px 0 rgba(0,0,0,0.5);display:-ms-grid;display:grid;margin:2rem 1rem 0.25rem 0.36rem;width:calc(100% - 1rem)}sticky-note-wrapper sticky-note>div:nth-child(2){clip-path:url(#stickyClip);display:-ms-grid;display:grid;font-family:"Kalam",cursive;font-style:1rem;font-weight:300;line-height:1.25rem;padding:1rem;place-items:center;text-align:center}sticky-note-wrapper sticky-note>div:nth-child(2)>*{font-family:"Kalam",cursive!important;font-style:normal!important;font-weight:300!important}@media screen and (max-width:1024px){sticky-note-wrapper sticky-note>div:nth-child(2){max-width:13rem;min-width:13rem;width:1rem}}@media screen and (max-width:768px){sticky-note-wrapper sticky-note>div:nth-child(2){font-size:1.75rem;max-width:21rem;min-height:21rem}}@media screen and (max-width:640px){sticky-note-wrapper sticky-note>div:nth-child(2){font-size:2.5rem;max-width:26rem;min-height:26rem}}sticky-note-wrapper sticky-note>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#ffffdd),color-stop(2%,#ffffd3),color-stop(12%,#ffffd3),color-stop(75%,#ffffc9),to(#ffffba));background:linear-gradient(180deg,#ffffdd 0%,#ffffd3 2%,#ffffd3 12%,#ffffc9 75%,#ffffba 100%)}sticky-note-wrapper sticky-note.blue>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#9dddec),color-stop(2%,#94daea),color-stop(12%,#94daea),color-stop(75%,#8bd7e8),to(#7fd3e6));background:linear-gradient(180deg,#9dddec 0%,#94daea 2%,#94daea 12%,#8bd7e8 75%,#7fd3e6 100%)}sticky-note-wrapper sticky-note.pink>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#fa7c93),color-stop(2%,#fa728b),color-stop(12%,#fa728b),color-stop(75%,#fa6883),to(#f95977));background:linear-gradient(180deg,#fa7c93 0%,#fa728b 2%,#fa728b 12%,#fa6883 75%,#f95977 100%)}sticky-note-wrapper sticky-note.green>div:nth-child(2){background:-webkit-gradient(linear,left top,left bottom,from(#c5fcc9),color-stop(2%,#bbfbc0),color-stop(12%,#bbfbc0),color-stop(75%,#b1fab7),to(#a3faaa));background:linear-gradient(180deg,#c5fcc9 0%,#bbfbc0 2%,#bbfbc0 12%,#b1fab7 75%,#a3faaa 100%)}sticky-note-wrapper:has(sticky-note:hover){background-color:#ffffd3;border:1px solid black}sticky-note-wrapper:has(sticky-note.yellow:hover){background-color:#ffffd3}sticky-note-wrapper:has(sticky-note.blue:hover){background-color:#94daea}sticky-note-wrapper:has(sticky-note.pink:hover){background-color:#fa728b}sticky-note-wrapper:has(sticky-note.green:hover){background-color:#bbfbc0}</pre>
|
||||||
<div tab="scss">
|
<div tab="scss">
|
||||||
<pre class="language-sass">$sticky-colors: ( [sass map with your own defined colours] );
|
<pre class="language-sass">$sticky-colors: ( [sass map with your own defined colours] );
|
||||||
@import "scss/core/switch/_sticky-note";
|
@use "scss/core/switch/_sticky-note";
|
||||||
@include sticky-note;
|
@include sticky-note;
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||||
@@ -279,38 +286,40 @@ const calculateStickyPosition = (s) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function init(p = document){
|
module.exports = {
|
||||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
init: (p = document) => {
|
||||||
|
|
||||||
p.querySelectorAll("sticky-note").forEach((s) => {
|
|
||||||
if (s.querySelectorAll("svg").length == 0) {
|
|
||||||
|
|
||||||
let wrapper = document.createElement("sticky-note-wrapper");
|
|
||||||
|
|
||||||
s.parentNode.insertBefore(wrapper, s);
|
|
||||||
wrapper.appendChild(s);
|
|
||||||
|
|
||||||
s.setAttribute("content", s.innerHTML.replace(/"/g, "\""));
|
|
||||||
s.innerHTML = `<div><svg width='0' height='0'><defs><clipPath id='stickyClip' clipPathUnits='objectBoundingBox'><path d='M 0 0 Q 0 0.69, 0.03 0.96 0.03 0.96, 1 0.96 Q 0.96 0.69, 0.96 0 0.96 0, 0 0' stroke-linejoin='round' stroke-linecap='square' /></clipPath></defs></svg></div><div><div>${s.innerHTML}</div></div>`;
|
|
||||||
}
|
|
||||||
calculateStickyPosition(s);
|
|
||||||
drag(s);
|
|
||||||
s.ondblclick = (e) => {
|
|
||||||
if (e.ctrlKey) {
|
|
||||||
calculateStickyPosition(s);
|
|
||||||
} else {
|
|
||||||
// add one click select
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
window.onresize = () => {
|
|
||||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||||
let stickies = p.querySelectorAll("sticky-note");
|
|
||||||
stickies.forEach((s) => {
|
p.querySelectorAll("sticky-note").forEach((s) => {
|
||||||
|
if (s.querySelectorAll("svg").length == 0) {
|
||||||
|
|
||||||
|
let wrapper = document.createElement("sticky-note-wrapper");
|
||||||
|
|
||||||
|
s.parentNode.insertBefore(wrapper, s);
|
||||||
|
wrapper.appendChild(s);
|
||||||
|
|
||||||
|
s.setAttribute("content", s.innerHTML.replace(/"/g, "\""));
|
||||||
|
s.innerHTML = `<div><svg width='0' height='0'><defs><clipPath id='stickyClip' clipPathUnits='objectBoundingBox'><path d='M 0 0 Q 0 0.69, 0.03 0.96 0.03 0.96, 1 0.96 Q 0.96 0.69, 0.96 0 0.96 0, 0 0' stroke-linejoin='round' stroke-linecap='square' /></clipPath></defs></svg></div><div><div>${s.innerHTML}</div></div>`;
|
||||||
|
}
|
||||||
calculateStickyPosition(s);
|
calculateStickyPosition(s);
|
||||||
});
|
drag(s);
|
||||||
|
s.ondblclick = (e) => {
|
||||||
|
if (e.ctrlKey) {
|
||||||
|
calculateStickyPosition(s);
|
||||||
|
} else {
|
||||||
|
// add one click select
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
window.onresize = () => {
|
||||||
|
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||||
|
let stickies = p.querySelectorAll("sticky-note");
|
||||||
|
stickies.forEach((s) => {
|
||||||
|
calculateStickyPosition(s);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<h2>What is it</h2>
|
<h2>What is it</h2>
|
||||||
@@ -20,7 +27,7 @@
|
|||||||
<pre class="language-pug" tab="pug">span#example-id(role="switch")</pre>
|
<pre class="language-pug" tab="pug">span#example-id(role="switch")</pre>
|
||||||
<pre class="language-css" tab="css">[role=switch]{display:-ms-inline-grid;display:inline-grid;border:1px solid #2e51a1;background-color:#d8d8d8;border-radius:0.75rem;height:1.5rem;width:3rem;-webkit-transition:all 500ms;transition:all 500ms}[role=switch]>span{display:inline-block;background-color:white;border-radius:50%;margin:2%;width:calc(1.5rem - 2%);-webkit-transition:all 500ms;transition:all 500ms}[role=switch][aria-checked=true]{background-color:#2e51a1}[role=switch][aria-checked=true]>span{margin-left:calc(1.5rem - 5%)}</pre>
|
<pre class="language-css" tab="css">[role=switch]{display:-ms-inline-grid;display:inline-grid;border:1px solid #2e51a1;background-color:#d8d8d8;border-radius:0.75rem;height:1.5rem;width:3rem;-webkit-transition:all 500ms;transition:all 500ms}[role=switch]>span{display:inline-block;background-color:white;border-radius:50%;margin:2%;width:calc(1.5rem - 2%);-webkit-transition:all 500ms;transition:all 500ms}[role=switch][aria-checked=true]{background-color:#2e51a1}[role=switch][aria-checked=true]>span{margin-left:calc(1.5rem - 5%)}</pre>
|
||||||
<div tab="scss">
|
<div tab="scss">
|
||||||
<pre class="language-sass">@import "scss/core/switch/_switch";
|
<pre class="language-sass">@use "scss/core/switch/_switch";
|
||||||
@include switch;
|
@include switch;
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||||
|
|||||||
@@ -42,60 +42,9 @@
|
|||||||
div(tab="[tab title]")
|
div(tab="[tab title]")
|
||||||
div(tab="[tab title]")
|
div(tab="[tab title]")
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="language-css" tab="css">tabset, .tab-group {
|
<pre class="language-css" tab="css">.tab-group,tabset{margin:2rem 0 1rem 0}.tab-group [role=tablist],tabset [role=tablist]{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0;padding:0}.tab-group [role=tablist] li.separator,tabset [role=tablist] li.separator{border-bottom:1px solid #7f7f7f;display:inline-block;margin:0.45rem 0 0 0;width:100%}.tab-group [role=tablist] li[role=tab],tabset [role=tablist] li[role=tab]{background-color:#FFF;border-left:1px solid #7f7f7f;border-right:1px solid #7f7f7f;border-radius:0.5rem 0.5rem 0 0;border-top:1px solid #7f7f7f;cursor:pointer;display:inline;margin:0;padding:1rem 1.5rem 0.14rem 1.5rem;z-index:2}.tab-group [role=tablist] li[role=tab]:last-of-type,tabset [role=tablist] li[role=tab]:last-of-type{border-right:1px solid #7f7f7f}.tab-group [role=tablist] li[role=tab]:not(.selected),tabset [role=tablist] li[role=tab]:not(.selected){background-color:#f0f0f0;border-bottom:1px solid #7f7f7f}.tab-group [role=tablist] li[role=tab] span,tabset [role=tablist] li[role=tab] span{display:block;margin:0 0 0.5rem 0}.tab-group .tab-hidden,tabset .tab-hidden{display:none}.tab-group [role=tabpanel],tabset [role=tabpanel]{background-color:#FFF;border:1px solid #7f7f7f;border-top:none;padding:1rem;z-index:1}.tab-group [role=tabpanel]:not(.open),tabset [role=tabpanel]:not(.open){display:none}</pre>
|
||||||
margin: 2rem 0 1rem 0;
|
|
||||||
}
|
|
||||||
tabset > ul, .tab-group > ul {
|
|
||||||
display: -webkit-box;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
tabset > ul li.separator, .tab-group > ul li.separator {
|
|
||||||
border-bottom: 1px solid #7f7f7f;
|
|
||||||
border-left: 1px solid #7f7f7f;
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0.45rem 0 0 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
tabset .tab-hidden, .tab-group .tab-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
tabset [role=tab], .tab-group [role=tab] {
|
|
||||||
background-color: #FFF;
|
|
||||||
border-left: 1px solid #7f7f7f;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
border-radius: 0.5rem 0.5rem 0 0;
|
|
||||||
cursor: pointer;
|
|
||||||
margin: 0;
|
|
||||||
display: inline;
|
|
||||||
padding: 1rem 1.5rem 0.14rem 1.5rem;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
tabset [role=tab]:last-of-type, .tab-group [role=tab]:last-of-type {
|
|
||||||
border-right: 1px solid #7f7f7f;
|
|
||||||
}
|
|
||||||
tabset [role=tab]:not(.selected), .tab-group [role=tab]:not(.selected) {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
border-bottom: 1px solid #7f7f7f;
|
|
||||||
}
|
|
||||||
tabset [role=tab] span, .tab-group [role=tab] span {
|
|
||||||
display: block;
|
|
||||||
margin: 0 0 0.5rem 0;
|
|
||||||
}
|
|
||||||
tabset [role=tabpanel], .tab-group [role=tabpanel] {
|
|
||||||
background-color: #FFF;
|
|
||||||
border: 1px solid #7f7f7f;
|
|
||||||
border-top: none;
|
|
||||||
padding: 1rem;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
tabset [role=tabpanel]:not(.open), .tab-group [role=tabpanel]:not(.open) {
|
|
||||||
display: none;
|
|
||||||
}</pre>
|
|
||||||
<div tab="scss">
|
<div tab="scss">
|
||||||
<pre class="language-sass">@import "scss/core/tabs/_tabs";
|
<pre class="language-sass">@use "scss/core/tabs/_tabs";
|
||||||
@include tabs{
|
@include tabs{
|
||||||
// optional content block
|
// optional content block
|
||||||
};
|
};
|
||||||
@@ -104,56 +53,66 @@ tabset [role=tabpanel]:not(.open), .tab-group [role=tabpanel]:not(.open) {
|
|||||||
// Licensed under CC BY-SA 4.0
|
// Licensed under CC BY-SA 4.0
|
||||||
|
|
||||||
$tab-border: #7f7f7f !default;
|
$tab-border: #7f7f7f !default;
|
||||||
|
$tab-panel-background-color: #FFF !default;
|
||||||
|
$tab-panel-top-border: #7f7f7f !default;
|
||||||
|
$tab-panel-top-border-width: 1px !default;
|
||||||
$tab-selected: #FFF !default;
|
$tab-selected: #FFF !default;
|
||||||
|
$tab-selected-text: #000 !default;
|
||||||
$tab-notselected: #f0f0f0 !default;
|
$tab-notselected: #f0f0f0 !default;
|
||||||
|
$tab-notselected-text: #000 !default;
|
||||||
|
|
||||||
@mixin tabs {
|
@mixin tabs {
|
||||||
tabset, .tab-group {
|
tabset, .tab-group {
|
||||||
margin: 2rem 0 1rem 0;
|
margin: 2rem 0 1rem 0;
|
||||||
> ul {
|
|
||||||
|
[role="tablist"] {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
li.separator {
|
|
||||||
border-bottom: 1px solid $tab-border;
|
li {
|
||||||
border-left: 1px solid $tab-border;
|
&.separator {
|
||||||
display: inline-block;
|
border-bottom: 1px solid $tab-border;
|
||||||
margin: .45rem 0 0 0;
|
display: inline-block;
|
||||||
width: 100%;
|
margin: .45rem 0 0 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[role="tab"] {
|
||||||
|
background-color: $tab-selected;
|
||||||
|
border-left: 1px solid $tab-border;
|
||||||
|
border-right: 1px solid $tab-border;
|
||||||
|
border-radius: .5rem .5rem 0 0;
|
||||||
|
border-top: 1px solid $tab-border;
|
||||||
|
cursor:pointer;
|
||||||
|
display: inline;
|
||||||
|
margin: 0;
|
||||||
|
padding: 1rem 1.5rem .14rem 1.5rem;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
&:last-of-type {
|
||||||
|
border-right: 1px solid $tab-border;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(.selected) {
|
||||||
|
background-color: $tab-notselected;
|
||||||
|
border-bottom: 1px solid $tab-border;
|
||||||
|
/// color
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 .5rem 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-hidden {
|
.tab-hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[role="tab"] {
|
|
||||||
background-color: $tab-selected;
|
|
||||||
border-left: 1px solid $tab-border;
|
|
||||||
border-top: 1px solid $tab-border;
|
|
||||||
border-radius: .5rem .5rem 0 0;
|
|
||||||
cursor:pointer;
|
|
||||||
margin: 0;
|
|
||||||
display: inline;
|
|
||||||
padding: 1rem 1.5rem .14rem 1.5rem;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
&:last-of-type {
|
|
||||||
border-right: 1px solid $tab-border;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(.selected) {
|
|
||||||
background-color: $tab-notselected;
|
|
||||||
border-bottom: 1px solid $tab-border;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
margin: 0 0 .5rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
[role="tabpanel"] {
|
[role="tabpanel"] {
|
||||||
background-color: $tab-selected;
|
background-color: $tab-selected;
|
||||||
border: 1px solid $tab-border;
|
border: 1px solid $tab-border;
|
||||||
@@ -167,6 +126,8 @@ $tab-notselected: #f0f0f0 !default;
|
|||||||
@content;
|
@content;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
</div>
|
</div>
|
||||||
@@ -205,79 +166,115 @@ const waitForElement = (selector) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const chooseTab = (tab) => {
|
||||||
|
const siblings = Array.from(tab.parentNode.children);
|
||||||
|
siblings.forEach(sibling => sibling.classList.remove("selected"));
|
||||||
|
tab.classList.add("selected");
|
||||||
|
|
||||||
|
const tabPanels = Array.from(tab.parentNode.parentNode.children)
|
||||||
|
tabPanels.forEach(panel => panel.classList.remove("open"));
|
||||||
|
|
||||||
export function init(container = document, spacer = true, args = {}) {
|
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||||
|
document.getElementById(tabPanelId).classList.add("open");
|
||||||
|
}
|
||||||
|
|
||||||
container.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
let pushState = 0;
|
||||||
|
let tabsetCount = 0;
|
||||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
module.exports = {
|
||||||
const tabgroup = tabGroup.getAttribute("id");
|
"init": (container = document, spacer = true, args = {}) => {
|
||||||
let tablist = "";
|
container.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||||
|
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||||
Array.from(tabGroup.children).forEach(child => {
|
if (tabGroup.getAttribute("id") == null) {
|
||||||
const tab = child.getAttribute("tab") || child.getAttribute("data-tab");
|
tabGroup.setAttribute("id", "tab-group-" + tabsetCount);
|
||||||
if (tab !== null) {
|
tabsetCount++;
|
||||||
const tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
|
||||||
const tabPanel = document.createElement('div');
|
|
||||||
tabPanel.id = `tab-panel-${tabgroup}-${tabID}`;
|
|
||||||
tabPanel.className = tablist === "" ? "open" : "";
|
|
||||||
tabPanel.setAttribute("role", "tabpanel");
|
|
||||||
tabPanel.setAttribute("tabindex", "0");
|
|
||||||
tabPanel.setAttribute("aria-labelledby", `tab-${tabgroup}-${tabID}`);
|
|
||||||
tabPanel.appendChild(child.cloneNode(true));
|
|
||||||
child.parentNode.replaceChild(tabPanel, child);
|
|
||||||
tablist += `<li tabindex="0" role="tab" ${tablist === "" ? "class='selected'" : ""} id="tab-${tabgroup}-${tabID}"><span>${tab}</span></li>`;
|
|
||||||
} else {
|
|
||||||
child.classList.add("tab-hidden");
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const ul = document.createElement('ul');
|
const tabgroup = tabGroup.getAttribute("id");
|
||||||
ul.setAttribute("role", "tablist");
|
let tablist = "";
|
||||||
ul.innerHTML = spacer != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
|
||||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
|
||||||
|
|
||||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
Array.from(tabGroup.children).forEach(child => {
|
||||||
tab.addEventListener("click", (e) => {
|
|
||||||
if (e.altKey && typeof args.altModifier == "function") {
|
// is details?
|
||||||
args.altModifier(tab);
|
let dtls = child.nodeName == "DETAILS" ? true : false;
|
||||||
} else if (e.shiftKey && typeof args.shiftModifier == "function") {
|
|
||||||
args.shiftModifier(tab);
|
// get the tab text
|
||||||
} else if (e.metaKey && typeof args.metaModifier == "function") {
|
let tab = dtls ? child.querySelector("summary").innerHTML : child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||||
args.metaModifier(tab);
|
|
||||||
|
// if the tab text is not blank
|
||||||
|
if (tab !== null) {
|
||||||
|
const tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
||||||
|
|
||||||
|
|
||||||
|
// define the tab panel content
|
||||||
|
let tabPanel = null;
|
||||||
|
if (dtls) {
|
||||||
|
tabPanel = child;
|
||||||
|
tabPanel.setAttribute("open", "");
|
||||||
|
} else {
|
||||||
|
tabPanel = document.createElement('div');
|
||||||
|
tabPanel.appendChild(child.cloneNode(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
tabPanel.id = `tab-panel-${tabgroup}-${tabID}`;
|
||||||
|
tabPanel.className = tablist === "" ? "open" : "";
|
||||||
|
tabPanel.setAttribute("role", "tabpanel");
|
||||||
|
tabPanel.setAttribute("tabindex", "0");
|
||||||
|
tabPanel.setAttribute("aria-labelledby", `tab-${tabgroup}-${tabID}`);
|
||||||
|
child.parentNode.replaceChild(tabPanel, child);
|
||||||
|
let cls = tablist === "" ? "class='selected'" : "";
|
||||||
|
tablist += `<li tabindex="0" role="tab" ${cls} id="tab-${tabgroup}-${tabID}"><span>${tab}</span></li>`;
|
||||||
} else {
|
} else {
|
||||||
const siblings = Array.from(tab.parentNode.children);
|
child.classList.add("tab-hidden");
|
||||||
siblings.forEach(sibling => sibling.classList.remove("selected"));
|
|
||||||
tab.classList.add("selected");
|
|
||||||
|
|
||||||
const tabPanels = Array.from(tab.parentNode.parentNode.children)
|
|
||||||
.filter(child => child.getAttribute("role") === "tabpanel");
|
|
||||||
tabPanels.forEach(panel => panel.classList.remove("open"));
|
|
||||||
|
|
||||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
|
||||||
document.getElementById(tabPanelId).classList.add("open");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ul = document.createElement('ul');
|
||||||
|
ul.setAttribute("role", "tablist");
|
||||||
|
ul.innerHTML = spacer != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||||
|
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||||
|
|
||||||
tab.addEventListener("keypress", (e) => {
|
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||||
e.preventDefault();
|
tab.addEventListener("click", (evt) => {
|
||||||
if( e.which == 32 || e.which == 13 ) {
|
if (pushState == 0) {
|
||||||
e.currentTarget.dispatchEvent(click);
|
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.parentNode.firstChild.getAttribute("id")}, "", `#${tab.parentNode.firstChild.getAttribute("id")}`);
|
||||||
}
|
pushState++;
|
||||||
})
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (document.location.hash != "" && document.location.hash.substring(0,5) == "#tab-") {
|
chooseTab(evt.currentTarget);
|
||||||
waitForElement(document.location.hash).then((el) => {
|
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.getAttribute("id")}, "", `#${tab.getAttribute("id")}`);
|
||||||
el.scrollIntoView();
|
pushState++;
|
||||||
el.dispatchEvent(click);
|
});
|
||||||
});
|
|
||||||
|
|
||||||
}
|
tab.addEventListener("keypress", (e) => {
|
||||||
});
|
e.preventDefault();
|
||||||
|
if( e.which == 32 || e.which == 13 ) {
|
||||||
|
e.currentTarget.dispatchEvent(click);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.location.hash != "" && document.location.hash.substring(0,5) == "#tab-") {
|
||||||
|
waitForElement(document.location.hash).then((el) => {
|
||||||
|
el.scrollIntoView();
|
||||||
|
el.focus();
|
||||||
|
el.dispatchEvent(click);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener("popstate", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (e.state != null) {
|
||||||
|
chooseTab(document.querySelector(`#${e.state.tab}`));
|
||||||
|
} else {
|
||||||
|
history.go(-1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
</tabset>
|
</tabset>
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pattern</title>
|
<title>Pattern</title>
|
||||||
|
<script>
|
||||||
|
let u = document.location.href.substring(0, document.location.href.search(/patterns/i));
|
||||||
|
let p = document.location.pathname.substring(document.location.pathname.search(/patterns/i));
|
||||||
|
p = p.replace(/\/$|\/index\.html/i, "").substring(9);
|
||||||
|
window.location = u + "?p=" + p;
|
||||||
|
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body data-prismjs-copy-timeout="1500">
|
<body data-prismjs-copy-timeout="1500">
|
||||||
<h2>What is it</h2>
|
<h2>What is it</h2>
|
||||||
@@ -182,11 +189,12 @@
|
|||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
<div tab="scss">
|
<div tab="scss">
|
||||||
<pre class="language-sass">@import "scss/core/tooltip/_tooltip";
|
<pre class="language-sass">@use "scss/core/tooltip/_tooltip";
|
||||||
@include tooltip;</pre>
|
@include tooltip;</pre>
|
||||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||||
//- Licensed under CC BY-SA 4.0
|
//- Licensed under CC BY-SA 4.0
|
||||||
|
|
||||||
|
$font-body: sans-serif !default;
|
||||||
$tooltip-border-radius: .5rem !default;
|
$tooltip-border-radius: .5rem !default;
|
||||||
$tooltip-dark-allow: true !default;
|
$tooltip-dark-allow: true !default;
|
||||||
$tooltip-dark-background: #1f2127 !default;
|
$tooltip-dark-background: #1f2127 !default;
|
||||||
@@ -215,6 +223,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
|||||||
border-radius: $tooltip-border-radius;
|
border-radius: $tooltip-border-radius;
|
||||||
color: $tooltip-light-foreground;
|
color: $tooltip-light-foreground;
|
||||||
filter: $tooltip-light-drop-shadow;
|
filter: $tooltip-light-drop-shadow;
|
||||||
|
$font-family: $font-body;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
inline-size: max-content;
|
inline-size: max-content;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- var lang = "en-uk"
|
- var lang = "en-uk"
|
||||||
- var colorpfx = "colour"
|
- var colorpfx = "colour"
|
||||||
- var headings = ["What is it", "When to use it", "How to use it"]
|
- var headings = ["What is it", "When to use it", "How to use it"]
|
||||||
|
- var downloadExtensions = ["js", "pug", "scss"]
|
||||||
- var generateColourToken = ["colours"]
|
- var generateColourToken = ["colours"]
|
||||||
|
|
||||||
-
|
-
|
||||||
@@ -49,7 +50,7 @@
|
|||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "breakpoints",
|
name: "breakpoint",
|
||||||
status: "complete",
|
status: "complete",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
@use "../pg/patterns/core/breakpoint/breakpoint";
|
||||||
|
|
||||||
@mixin core-colour-samples {
|
@mixin core-colour-samples {
|
||||||
|
|
||||||
#copystatus {
|
#copystatus {
|
||||||
@@ -36,14 +38,14 @@
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
@include break(-lg) {
|
@include breakpoint.break(-lg) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include break(-sm) {
|
@include breakpoint.break(-sm) {
|
||||||
grid-template-columns: auto;
|
grid-template-columns: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -67,7 +69,7 @@
|
|||||||
width: 20rem;
|
width: 20rem;
|
||||||
max-width: 318px;
|
max-width: 318px;
|
||||||
|
|
||||||
@include break(-lg) {
|
@include breakpoint.break(-lg) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
@@ -102,7 +104,7 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
gap: .5rem;
|
gap: .5rem;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-template-rows: 2.5rem repeat(2, max-content);
|
grid-template-rows: repeat(3, max-content);
|
||||||
.result {
|
.result {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
|
|||||||
@@ -5,271 +5,18 @@
|
|||||||
This file is generates _core.scss using information in ../pg/_config.pug.
|
This file is generates _core.scss using information in ../pg/_config.pug.
|
||||||
Please make your changes in your _config.pug file so that they are not
|
Please make your changes in your _config.pug file so that they are not
|
||||||
overwritten. \n*/\n\n\n`
|
overwritten. \n*/\n\n\n`
|
||||||
|
| !{out}
|
||||||
|
|
||||||
|
|
||||||
include ../_config
|
include ../_config
|
||||||
include _colour-samples
|
include _colour-samples
|
||||||
|
include _core-colour-samples.scss
|
||||||
|
|
||||||
|
- out = `\n\n//colour tokens\n$${colorpfx}: (`
|
||||||
-
|
|
||||||
out +=`@mixin core-colour-samples {
|
|
||||||
|
|
||||||
#copystatus {
|
|
||||||
left: 50%;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 100;
|
|
||||||
div {
|
|
||||||
border-radius: 1rem;
|
|
||||||
border: 1px solid green;
|
|
||||||
left: -50%;
|
|
||||||
padding: 1rem;
|
|
||||||
position: relative;
|
|
||||||
white-space: nowrap;
|
|
||||||
&::after {
|
|
||||||
clear: both;
|
|
||||||
content: " ";
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
&.succeeded {
|
|
||||||
background-color: white;
|
|
||||||
border-color: black;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
&.failed {
|
|
||||||
background-color: white;
|
|
||||||
border-color: #f00;
|
|
||||||
color: #f00;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
color-samples {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
|
|
||||||
@include break(-lg) {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
max-width: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include break(-sm) {
|
|
||||||
grid-template-columns: auto;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
color-sample {
|
|
||||||
align-items: center;
|
|
||||||
border-radius: .5rem;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
display: grid;
|
|
||||||
font-family: inherit;
|
|
||||||
gap: .5rem;
|
|
||||||
grid-template-areas: "name name name hex hex hex"
|
|
||||||
"name name name rgb rgb rgb"
|
|
||||||
"acc acc acc acc acc acc"
|
|
||||||
"lighter lighter lighter darker darker darker"
|
|
||||||
"notes notes notes notes notes notes";
|
|
||||||
grid-template-columns: repeat(6, 1fr);
|
|
||||||
grid-template-rows: repeat(2, 1.5rem) repeat(4, max-content); // 3rem repeat(2, 2rem) 1.5rem repeat(3, max-content);
|
|
||||||
padding: 1rem;
|
|
||||||
width: 20rem;
|
|
||||||
max-width: 318px;
|
|
||||||
|
|
||||||
@include break(-lg) {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
name {
|
|
||||||
align-self: start;
|
|
||||||
font-size: 1.25rem;
|
|
||||||
grid-area: name;
|
|
||||||
span {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rgb {
|
|
||||||
grid-area: rgb;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
hex {
|
|
||||||
grid-area: hex;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
> accessibility {
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
border-top: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
accessibility {
|
|
||||||
grid-area: acc;
|
|
||||||
grid-row: 3;
|
|
||||||
padding: .5rem 0;
|
|
||||||
|
|
||||||
display: grid;
|
|
||||||
gap: .5rem;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
grid-template-rows: repeat(3, max-content);
|
|
||||||
.result {
|
|
||||||
align-items: center;
|
|
||||||
border-radius: .5rem;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 0 1rem;
|
|
||||||
text-align: center;
|
|
||||||
&.accwaa, &.accwaaa {
|
|
||||||
background-color: white;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
&.accbaa, &.accbaaa {
|
|
||||||
background-color: black;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
span:nth-child(2) {
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.aa, .aaa {
|
|
||||||
align-self: center;
|
|
||||||
display: block;
|
|
||||||
font-size: .75rem;
|
|
||||||
}
|
|
||||||
.acchb {
|
|
||||||
grid-column: 2;
|
|
||||||
}
|
|
||||||
.acchb, .acchw {
|
|
||||||
display: grid;
|
|
||||||
grid-tempate-columns: auto;
|
|
||||||
grid-template-rows: repeat(2, max-content);
|
|
||||||
align-self: start;
|
|
||||||
text-align: center;
|
|
||||||
padding: 0;
|
|
||||||
span {
|
|
||||||
grid-row: 1;
|
|
||||||
grid-column: 1 / -1;
|
|
||||||
font-size: .9rem;
|
|
||||||
}
|
|
||||||
small {
|
|
||||||
text-align: center;
|
|
||||||
grid-row: 2;
|
|
||||||
grid-column: 1 / -1;
|
|
||||||
font-size: .75rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sample-block {
|
|
||||||
align-self: start;
|
|
||||||
grid-column: span 3;
|
|
||||||
grid-row: 4;
|
|
||||||
color-pill {
|
|
||||||
display: grid;
|
|
||||||
grid-gap: .5rem;
|
|
||||||
grid-template-columns: 20px max-content auto;
|
|
||||||
:nth-child(1) {
|
|
||||||
align-self: center;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
display: inline-block;
|
|
||||||
height: 10px;
|
|
||||||
width: 20px;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
cursor: pointer;
|
|
||||||
.tooltip-tc {
|
|
||||||
padding: .5rem;
|
|
||||||
width: 20rem;
|
|
||||||
max-width: 318px;
|
|
||||||
height: max-contents;
|
|
||||||
|
|
||||||
display: grid;
|
|
||||||
gap: .5rem;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
grid-template-rows: repeat(3, max-content);
|
|
||||||
.result {
|
|
||||||
align-items: center;
|
|
||||||
border-radius: .5rem;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 0 1rem;
|
|
||||||
text-align: center;
|
|
||||||
&.accwaa, &.accwaaa {
|
|
||||||
background-color: white;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
&.accbaa, &.accbaaa {
|
|
||||||
background-color: black;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
span{ border: none;
|
|
||||||
&:nth-child(2) {
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.aa, .aaa {
|
|
||||||
align-self: center;
|
|
||||||
display: block;
|
|
||||||
font-size: .75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.acchb {
|
|
||||||
grid-column: 2;
|
|
||||||
}
|
|
||||||
.acchb, .acchw {
|
|
||||||
border: none;
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
place-self: stretch;
|
|
||||||
text-align: center;
|
|
||||||
span {
|
|
||||||
border: none;
|
|
||||||
font-size: .9rem;
|
|
||||||
width: 100%;
|
|
||||||
&::after, &::before {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
small {
|
|
||||||
font-size: .75rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
notes {
|
|
||||||
border-top: 1px solid #ccc;
|
|
||||||
grid-column: 1 / -1;
|
|
||||||
padding-top: .5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- out += `\n\n//colour tokens\n$${colorpfx}: (`
|
|
||||||
|
|
||||||
each val in generateColourToken
|
each val in generateColourToken
|
||||||
- out += generateSCSS(eval(val), colorpfx)
|
- out += generateSCSS(eval(val), colorpfx)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//- var scss = $colors
|
//- var scss = $colors
|
||||||
| !{generateSCSS(eval(val), colorpfx)}
|
| !{generateSCSS(eval(val), colorpfx)}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
include ../_config.pug
|
||||||
|
|
||||||
|
if typeof downloadExtensions == "undefined"
|
||||||
|
- var extensions = `["js", "scss", "hello"]`
|
||||||
|
else
|
||||||
|
- var extensions = []
|
||||||
|
each ext in downloadExtensions
|
||||||
|
- extensions.push("'" + ext + "'")
|
||||||
|
- extensions = "[" + extensions + "]"
|
||||||
|
|
||||||
-
|
-
|
||||||
var php = `<?php
|
var php = `<?php
|
||||||
function recursor($dir, $type) {
|
function recursor($dir, $type) {
|
||||||
@@ -25,7 +35,7 @@
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$allowed_types = ["scss", "js"];
|
$allowed_types = {{extensions}};
|
||||||
$patterns = dirname(dirname(__file__)) . "/src/pg/patterns";
|
$patterns = dirname(dirname(__file__)) . "/src/pg/patterns";
|
||||||
|
|
||||||
|
|
||||||
@@ -50,5 +60,7 @@
|
|||||||
|
|
||||||
header('Content-type: application/zip');
|
header('Content-type: application/zip');
|
||||||
header(sprintf('Content-Disposition: attachment; filename="%s.zip"', $type));
|
header(sprintf('Content-Disposition: attachment; filename="%s.zip"', $type));
|
||||||
echo(file_get_contents($t)); ?>`
|
echo(file_get_contents($t)); ?>`.replace("{{extensions}}", extensions)
|
||||||
| !{php}
|
| !{php}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// default breakpoints match bootstrap 5 breakpoints.
|
// default breakpoints match bootstrap 5 breakpoints.
|
||||||
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px ) !default;
|
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px ) !default;
|
||||||
|
|
||||||
@mixin breakpoint-debug {
|
@mixin debug {
|
||||||
body::before, body::after {
|
body::before, body::after {
|
||||||
background-color: #555;
|
background-color: #555;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -21,10 +21,10 @@ block content
|
|||||||
div(tab="scss")
|
div(tab="scss")
|
||||||
+h(3)
|
+h(3)
|
||||||
pre.language-sass.
|
pre.language-sass.
|
||||||
@import "scss/core/breakpoints/breakpoints";
|
@use "scss/core/breakpoint/breakpoint";
|
||||||
@include break([breakpoint]) {
|
@include breapoint.break([breakpoint]) {
|
||||||
// css here
|
// css here
|
||||||
}
|
}
|
||||||
+h(4)
|
+h(4)
|
||||||
pre.language-sass
|
pre.language-sass
|
||||||
include _breakpoints.scss
|
include _breakpoint.scss
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
header
|
header
|
||||||
// The headline banner area
|
// The headline banner area
|
||||||
svg(height='5.5rem' width='100%' xmlns='http://www.w3.org/2000/svg' aria-hidden='true')
|
svg(style="height: 5.5rem; width: 100%" xmlns='http://www.w3.org/2000/svg' aria-hidden='true')
|
||||||
text= site
|
text= site
|
||||||
div
|
div
|
||||||
div.header-title
|
div.header-title
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
header
|
header
|
||||||
// The headline banner area
|
// The headline banner area
|
||||||
svg(height='5.5rem' width='100%' xmlns='http://www.w3.org/2000/svg' aria-hidden='true')
|
svg(style="height: 5.5rem; width: 100%" xmlns='http://www.w3.org/2000/svg' aria-hidden='true')
|
||||||
text= site
|
text= site
|
||||||
div
|
div
|
||||||
div.header-title
|
div.header-title
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ block content
|
|||||||
div.language-sass(tab="scss")
|
div.language-sass(tab="scss")
|
||||||
|
|
||||||
pre.language-sass.
|
pre.language-sass.
|
||||||
@import "scss/core/header/header;
|
@use "scss/core/header/header;
|
||||||
|
|
||||||
pre.language-sass
|
pre.language-sass
|
||||||
include _header.scss
|
include _header.scss
|
||||||
@@ -6,13 +6,13 @@ block content
|
|||||||
-
|
-
|
||||||
- let list = []
|
- let list = []
|
||||||
- for(let i = 0; i < content.length; i++) {
|
- for(let i = 0; i < content.length; i++) {
|
||||||
- list.push({ "name": content[i].name, "path": content[i].name, "status": content[i].status, "display": (content[i].hasOwnProperty("display") && content[i].display != "" ? content[i].display : content[i].name.toSentenceCase().toContent()) } )
|
- list.push({ "name": content[i].name, "core": (typeof content[i].core != 'undefined' && content[i].core ? 'true' : 'false'), "path": content[i].name, "status": content[i].status, "display": (content[i].hasOwnProperty("display") && content[i].display != "" ? content[i].display : content[i].name.toSentenceCase().toContent()) } )
|
||||||
- if (content[i].files != undefined) {
|
- if (content[i].files != undefined) {
|
||||||
- for (let ii = 0; ii < content[i].files.length; ii++) {
|
- for (let ii = 0; ii < content[i].files.length; ii++) {
|
||||||
- list.push({ "name": content[i].files[ii].name, "path": content[i].name +"."+ content[i].files[ii].name, "status": content[i].files[ii].status, "display": (content[i].files[ii].hasOwnProperty("display") && content[i].files[ii].display != "" ? content[i].files[ii].display : content[i].files[ii].name.toSentenceCase().toContent()) } )
|
- list.push({ "name": content[i].files[ii].name, "core": (typeof content[i].files[ii].core != 'undefined' && content[i].files[ii].core ? 'true' : 'false'), "path": content[i].name +"."+ content[i].files[ii].name, "status": content[i].files[ii].status, "display": (content[i].files[ii].hasOwnProperty("display") && content[i].files[ii].display != "" ? content[i].files[ii].display : content[i].files[ii].name.toSentenceCase().toContent()) } )
|
||||||
- if (content[i].files[ii].files != undefined) {
|
- if (content[i].files[ii].files != undefined) {
|
||||||
- for (let iii = 0; iii < content[i].files[ii].files.length; iii++) {
|
- for (let iii = 0; iii < content[i].files[ii].files.length; iii++) {
|
||||||
- list.push({ "name": content[i].files[ii].files[iii].name, "path": content[i].name +"."+ content[i].files[ii].name + "." + content[i].files[ii].files[iii].name, "status": content[i].files[ii].files[iii].status, "display": (content[i].files[ii].files[iii].hasOwnProperty("display") && content[i].files[ii].files[iii].display != "" ? content[i].files[ii].files[iii].display : content[i].files[ii].files[iii].name.toSentenceCase().toContent()) } )
|
- list.push({ "name": content[i].files[ii].files[iii].name, "core": (typeof content[i].files[ii].files[iii].core != 'undefined' && content[i].files[ii].files[iii].core ? 'true' : 'false'), "path": content[i].name +"."+ content[i].files[ii].name + "." + content[i].files[ii].files[iii].name, "status": content[i].files[ii].files[iii].status, "display": (content[i].files[ii].files[iii].hasOwnProperty("display") && content[i].files[ii].files[iii].display != "" ? content[i].files[ii].files[iii].display : content[i].files[ii].files[iii].name.toSentenceCase().toContent()) } )
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
@@ -26,7 +26,7 @@ block content
|
|||||||
- return 1;
|
- return 1;
|
||||||
- }
|
- }
|
||||||
- return 0;
|
- return 0;
|
||||||
- });
|
- });
|
||||||
- function createURL(p) {
|
- function createURL(p) {
|
||||||
- p = p.split(".")
|
- p = p.split(".")
|
||||||
// - return p.length
|
// - return p.length
|
||||||
@@ -64,7 +64,10 @@ block content
|
|||||||
else
|
else
|
||||||
| !{category.name.toContent().toSentenceCase()}
|
| !{category.name.toContent().toSentenceCase()}
|
||||||
td
|
td
|
||||||
span(class="status-" + category.status)= category.status.toContent().toSentenceCase()
|
if typeof category.core && category.core
|
||||||
|
span.status-complete Complete (Core)
|
||||||
|
else
|
||||||
|
span(class="status-" + category.status)= category.status.toContent().toSentenceCase()
|
||||||
|
|
||||||
|
|
||||||
if category.files
|
if category.files
|
||||||
@@ -77,7 +80,10 @@ block content
|
|||||||
else
|
else
|
||||||
| !{pattern.name.toContent().toSentenceCase()}
|
| !{pattern.name.toContent().toSentenceCase()}
|
||||||
td
|
td
|
||||||
span(class="status-" + pattern.status)= pattern.status.toContent().toSentenceCase()
|
if typeof pattern.core && pattern.core
|
||||||
|
span.status-complete Complete (Core)
|
||||||
|
else
|
||||||
|
span(class="status-" + pattern.status)= pattern.status.toContent().toSentenceCase()
|
||||||
|
|
||||||
if pattern.files
|
if pattern.files
|
||||||
|
|
||||||
@@ -90,14 +96,22 @@ block content
|
|||||||
else
|
else
|
||||||
| !{sub.name.toContent().toSentenceCase()}
|
| !{sub.name.toContent().toSentenceCase()}
|
||||||
td
|
td
|
||||||
span(class="status-" + sub.status)= sub.status.toContent().toSentenceCase()
|
if typeof sub.core && sub.core
|
||||||
|
span.status-complete Complete (Core)
|
||||||
|
else
|
||||||
|
span(class="status-" + sub.status)= sub.status.toContent().toSentenceCase()
|
||||||
|
|
||||||
div.status-report.status-report-status(data-tab="by status")
|
div.status-report.status-report-status(data-tab="by status")
|
||||||
table(role="presentation")
|
table(role="presentation")
|
||||||
|
|
||||||
tbody
|
tbody
|
||||||
|
- bystatus = list;
|
||||||
|
- for(i=0; i < bystatus.length; i++) {
|
||||||
|
- if (bystatus[i].core == "true") {
|
||||||
|
- bystatus[i].status = "complete"
|
||||||
|
- }
|
||||||
|
- }
|
||||||
each status in statuses || []
|
each status in statuses || []
|
||||||
- out = list.filter(list => list.status === status.name)
|
- out = bystatus.filter(list => list.status === status.name)
|
||||||
tr
|
tr
|
||||||
td(colspan="2")
|
td(colspan="2")
|
||||||
span(class="status-" + status.name)= status.name.toContent().toSentenceCase() + " (" + out.length + ")"
|
span(class="status-" + status.name)= status.name.toContent().toSentenceCase() + " (" + out.length + ")"
|
||||||
@@ -110,6 +124,9 @@ block content
|
|||||||
| !{item.display}
|
| !{item.display}
|
||||||
else
|
else
|
||||||
| !{item.name.toContent().toSentenceCase()}
|
| !{item.name.toContent().toSentenceCase()}
|
||||||
|
td
|
||||||
|
if item.core == "true"
|
||||||
|
span (core)
|
||||||
td= getCategory(item.path)
|
td= getCategory(item.path)
|
||||||
|
|
||||||
div.status-report.status-report-alpha(data-tab="alphabetical")
|
div.status-report.status-report-alpha(data-tab="alphabetical")
|
||||||
@@ -124,7 +141,10 @@ block content
|
|||||||
else
|
else
|
||||||
| !{item.name.toContent().toSentenceCase()}
|
| !{item.name.toContent().toSentenceCase()}
|
||||||
td
|
td
|
||||||
span
|
span
|
||||||
span(class="status-" + item.status)= item.status.toContent().toTitleCase()
|
if item.core == "true"
|
||||||
|
span.status-complete Complete (Core)
|
||||||
|
else
|
||||||
|
span(class="status-" + item.status)= item.status.toContent().toTitleCase()
|
||||||
td= getCategory(item.path)
|
td= getCategory(item.path)
|
||||||
|
|
||||||
|
|||||||
@@ -95,37 +95,39 @@ const calculateStickyPosition = (s) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function init(p = document){
|
module.exports = {
|
||||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
init: (p = document) => {
|
||||||
|
|
||||||
p.querySelectorAll("sticky-note").forEach((s) => {
|
|
||||||
if (s.querySelectorAll("svg").length == 0) {
|
|
||||||
|
|
||||||
let wrapper = document.createElement("sticky-note-wrapper");
|
|
||||||
|
|
||||||
s.parentNode.insertBefore(wrapper, s);
|
|
||||||
wrapper.appendChild(s);
|
|
||||||
|
|
||||||
s.setAttribute("content", s.innerHTML.replace(/"/g, "\""));
|
|
||||||
s.innerHTML = `<div><svg width='0' height='0'><defs><clipPath id='stickyClip' clipPathUnits='objectBoundingBox'><path d='M 0 0 Q 0 0.69, 0.03 0.96 0.03 0.96, 1 0.96 Q 0.96 0.69, 0.96 0 0.96 0, 0 0' stroke-linejoin='round' stroke-linecap='square' /></clipPath></defs></svg></div><div><div>${s.innerHTML}</div></div>`;
|
|
||||||
}
|
|
||||||
calculateStickyPosition(s);
|
|
||||||
drag(s);
|
|
||||||
s.ondblclick = (e) => {
|
|
||||||
if (e.ctrlKey) {
|
|
||||||
calculateStickyPosition(s);
|
|
||||||
} else {
|
|
||||||
// add one click select
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
window.onresize = () => {
|
|
||||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||||
let stickies = p.querySelectorAll("sticky-note");
|
|
||||||
stickies.forEach((s) => {
|
p.querySelectorAll("sticky-note").forEach((s) => {
|
||||||
|
if (s.querySelectorAll("svg").length == 0) {
|
||||||
|
|
||||||
|
let wrapper = document.createElement("sticky-note-wrapper");
|
||||||
|
|
||||||
|
s.parentNode.insertBefore(wrapper, s);
|
||||||
|
wrapper.appendChild(s);
|
||||||
|
|
||||||
|
s.setAttribute("content", s.innerHTML.replace(/"/g, "\""));
|
||||||
|
s.innerHTML = `<div><svg width='0' height='0'><defs><clipPath id='stickyClip' clipPathUnits='objectBoundingBox'><path d='M 0 0 Q 0 0.69, 0.03 0.96 0.03 0.96, 1 0.96 Q 0.96 0.69, 0.96 0 0.96 0, 0 0' stroke-linejoin='round' stroke-linecap='square' /></clipPath></defs></svg></div><div><div>${s.innerHTML}</div></div>`;
|
||||||
|
}
|
||||||
calculateStickyPosition(s);
|
calculateStickyPosition(s);
|
||||||
});
|
drag(s);
|
||||||
|
s.ondblclick = (e) => {
|
||||||
|
if (e.ctrlKey) {
|
||||||
|
calculateStickyPosition(s);
|
||||||
|
} else {
|
||||||
|
// add one click select
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
window.onresize = () => {
|
||||||
|
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||||
|
let stickies = p.querySelectorAll("sticky-note");
|
||||||
|
stickies.forEach((s) => {
|
||||||
|
calculateStickyPosition(s);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ block content
|
|||||||
+h(3)
|
+h(3)
|
||||||
pre.language-sass.
|
pre.language-sass.
|
||||||
$sticky-colors: ( [sass map with your own defined colours] );
|
$sticky-colors: ( [sass map with your own defined colours] );
|
||||||
@import "scss/core/switch/_sticky-note";
|
@use "scss/core/switch/_sticky-note";
|
||||||
@include sticky-note;
|
@include sticky-note;
|
||||||
|
|
||||||
+h(4)
|
+h(4)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ block content
|
|||||||
div(tab="scss")
|
div(tab="scss")
|
||||||
+h(3)
|
+h(3)
|
||||||
pre.language-sass.
|
pre.language-sass.
|
||||||
@import "scss/core/switch/_switch";
|
@use "scss/core/switch/_switch";
|
||||||
@include switch;
|
@include switch;
|
||||||
|
|
||||||
+h(4)
|
+h(4)
|
||||||
|
|||||||
@@ -30,76 +30,112 @@ const waitForElement = (selector) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const chooseTab = (tab) => {
|
||||||
|
const siblings = Array.from(tab.parentNode.children);
|
||||||
|
siblings.forEach(sibling => sibling.classList.remove("selected"));
|
||||||
|
tab.classList.add("selected");
|
||||||
|
|
||||||
|
const tabPanels = Array.from(tab.parentNode.parentNode.children)
|
||||||
|
tabPanels.forEach(panel => panel.classList.remove("open"));
|
||||||
|
|
||||||
export function init(container = document, spacer = true, args = {}) {
|
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||||
|
document.getElementById(tabPanelId).classList.add("open");
|
||||||
|
}
|
||||||
|
|
||||||
container.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
let pushState = 0;
|
||||||
|
let tabsetCount = 0;
|
||||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
module.exports = {
|
||||||
const tabgroup = tabGroup.getAttribute("id");
|
"init": (container = document, spacer = true, args = {}) => {
|
||||||
let tablist = "";
|
container.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||||
|
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||||
Array.from(tabGroup.children).forEach(child => {
|
if (tabGroup.getAttribute("id") == null) {
|
||||||
const tab = child.getAttribute("tab") || child.getAttribute("data-tab");
|
tabGroup.setAttribute("id", "tab-group-" + tabsetCount);
|
||||||
if (tab !== null) {
|
tabsetCount++;
|
||||||
const tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
|
||||||
const tabPanel = document.createElement('div');
|
|
||||||
tabPanel.id = `tab-panel-${tabgroup}-${tabID}`;
|
|
||||||
tabPanel.className = tablist === "" ? "open" : "";
|
|
||||||
tabPanel.setAttribute("role", "tabpanel");
|
|
||||||
tabPanel.setAttribute("tabindex", "0");
|
|
||||||
tabPanel.setAttribute("aria-labelledby", `tab-${tabgroup}-${tabID}`);
|
|
||||||
tabPanel.appendChild(child.cloneNode(true));
|
|
||||||
child.parentNode.replaceChild(tabPanel, child);
|
|
||||||
tablist += `<li tabindex="0" role="tab" ${tablist === "" ? "class='selected'" : ""} id="tab-${tabgroup}-${tabID}"><span>${tab}</span></li>`;
|
|
||||||
} else {
|
|
||||||
child.classList.add("tab-hidden");
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const ul = document.createElement('ul');
|
const tabgroup = tabGroup.getAttribute("id");
|
||||||
ul.setAttribute("role", "tablist");
|
let tablist = "";
|
||||||
ul.innerHTML = spacer != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
|
||||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
|
||||||
|
|
||||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
Array.from(tabGroup.children).forEach(child => {
|
||||||
tab.addEventListener("click", (e) => {
|
|
||||||
if (e.altKey && typeof args.altModifier == "function") {
|
// is details?
|
||||||
args.altModifier(tab);
|
let dtls = child.nodeName == "DETAILS" ? true : false;
|
||||||
} else if (e.shiftKey && typeof args.shiftModifier == "function") {
|
|
||||||
args.shiftModifier(tab);
|
// get the tab text
|
||||||
} else if (e.metaKey && typeof args.metaModifier == "function") {
|
let tab = dtls ? child.querySelector("summary").innerHTML : child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||||
args.metaModifier(tab);
|
|
||||||
|
// if the tab text is not blank
|
||||||
|
if (tab !== null) {
|
||||||
|
const tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
||||||
|
|
||||||
|
|
||||||
|
// define the tab panel content
|
||||||
|
let tabPanel = null;
|
||||||
|
if (dtls) {
|
||||||
|
tabPanel = child;
|
||||||
|
tabPanel.setAttribute("open", "");
|
||||||
|
} else {
|
||||||
|
tabPanel = document.createElement('div');
|
||||||
|
tabPanel.appendChild(child.cloneNode(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
tabPanel.id = `tab-panel-${tabgroup}-${tabID}`;
|
||||||
|
tabPanel.className = tablist === "" ? "open" : "";
|
||||||
|
tabPanel.setAttribute("role", "tabpanel");
|
||||||
|
tabPanel.setAttribute("tabindex", "0");
|
||||||
|
tabPanel.setAttribute("aria-labelledby", `tab-${tabgroup}-${tabID}`);
|
||||||
|
child.parentNode.replaceChild(tabPanel, child);
|
||||||
|
let cls = tablist === "" ? "class='selected'" : "";
|
||||||
|
tablist += `<li tabindex="0" role="tab" ${cls} id="tab-${tabgroup}-${tabID}"><span>${tab}</span></li>`;
|
||||||
} else {
|
} else {
|
||||||
const siblings = Array.from(tab.parentNode.children);
|
child.classList.add("tab-hidden");
|
||||||
siblings.forEach(sibling => sibling.classList.remove("selected"));
|
|
||||||
tab.classList.add("selected");
|
|
||||||
|
|
||||||
const tabPanels = Array.from(tab.parentNode.parentNode.children)
|
|
||||||
.filter(child => child.getAttribute("role") === "tabpanel");
|
|
||||||
tabPanels.forEach(panel => panel.classList.remove("open"));
|
|
||||||
|
|
||||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
|
||||||
document.getElementById(tabPanelId).classList.add("open");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ul = document.createElement('ul');
|
||||||
|
ul.setAttribute("role", "tablist");
|
||||||
|
ul.innerHTML = spacer != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||||
|
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||||
|
|
||||||
tab.addEventListener("keypress", (e) => {
|
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||||
e.preventDefault();
|
tab.addEventListener("click", (evt) => {
|
||||||
if( e.which == 32 || e.which == 13 ) {
|
if (pushState == 0) {
|
||||||
e.currentTarget.dispatchEvent(click);
|
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.parentNode.firstChild.getAttribute("id")}, "", `#${tab.parentNode.firstChild.getAttribute("id")}`);
|
||||||
}
|
pushState++;
|
||||||
})
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (document.location.hash != "" && document.location.hash.substring(0,5) == "#tab-") {
|
chooseTab(evt.currentTarget);
|
||||||
waitForElement(document.location.hash).then((el) => {
|
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.getAttribute("id")}, "", `#${tab.getAttribute("id")}`);
|
||||||
el.scrollIntoView();
|
pushState++;
|
||||||
el.dispatchEvent(click);
|
});
|
||||||
});
|
|
||||||
|
|
||||||
}
|
tab.addEventListener("keypress", (e) => {
|
||||||
});
|
e.preventDefault();
|
||||||
|
if( e.which == 32 || e.which == 13 ) {
|
||||||
|
e.currentTarget.dispatchEvent(click);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.location.hash != "" && document.location.hash.substring(0,5) == "#tab-") {
|
||||||
|
waitForElement(document.location.hash).then((el) => {
|
||||||
|
el.scrollIntoView();
|
||||||
|
el.focus();
|
||||||
|
el.dispatchEvent(click);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener("popstate", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (e.state != null) {
|
||||||
|
chooseTab(document.querySelector(`#${e.state.tab}`));
|
||||||
|
} else {
|
||||||
|
history.go(-1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +1,78 @@
|
|||||||
// DS2 core (c) 2024 Alexander McIlwraith
|
// DS2 core (c) 2024 Alexander McIlwraith
|
||||||
// Licensed under CC BY-SA 4.0
|
// Licensed under CC BY-SA 4.0
|
||||||
|
|
||||||
$tab-border: #7f7f7f !default;
|
$tab-border: #7f7f7f !default;
|
||||||
$tab-selected: #FFF !default;
|
$tab-panel-background-color: #FFF !default;
|
||||||
$tab-notselected: #f0f0f0 !default;
|
$tab-panel-top-border: #7f7f7f !default;
|
||||||
|
$tab-panel-top-border-width: 1px !default;
|
||||||
@mixin tabs {
|
$tab-selected: #FFF !default;
|
||||||
tabset, .tab-group {
|
$tab-selected-text: #000 !default;
|
||||||
margin: 2rem 0 1rem 0;
|
$tab-notselected: #f0f0f0 !default;
|
||||||
> ul {
|
$tab-notselected-text: #000 !default;
|
||||||
display: flex;
|
|
||||||
margin: 0;
|
@mixin tabs {
|
||||||
padding: 0;
|
tabset, .tab-group {
|
||||||
|
margin: 2rem 0 1rem 0;
|
||||||
li.separator {
|
|
||||||
border-bottom: 1px solid $tab-border;
|
[role="tablist"] {
|
||||||
border-left: 1px solid $tab-border;
|
display: flex;
|
||||||
display: inline-block;
|
margin: 0;
|
||||||
margin: .45rem 0 0 0;
|
padding: 0;
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
li {
|
||||||
|
&.separator {
|
||||||
.tab-hidden {
|
border-bottom: 1px solid $tab-border;
|
||||||
display: none;
|
display: inline-block;
|
||||||
}
|
margin: .45rem 0 0 0;
|
||||||
|
width: 100%;
|
||||||
[role="tab"] {
|
}
|
||||||
background-color: $tab-selected;
|
|
||||||
border-left: 1px solid $tab-border;
|
&[role="tab"] {
|
||||||
border-top: 1px solid $tab-border;
|
background-color: $tab-selected;
|
||||||
border-radius: .5rem .5rem 0 0;
|
border-left: 1px solid $tab-border;
|
||||||
cursor:pointer;
|
border-right: 1px solid $tab-border;
|
||||||
margin: 0;
|
border-radius: .5rem .5rem 0 0;
|
||||||
display: inline;
|
border-top: 1px solid $tab-border;
|
||||||
padding: 1rem 1.5rem .14rem 1.5rem;
|
cursor:pointer;
|
||||||
z-index: 2;
|
display: inline;
|
||||||
|
margin: 0;
|
||||||
&:last-of-type {
|
padding: 1rem 1.5rem .14rem 1.5rem;
|
||||||
border-right: 1px solid $tab-border;
|
z-index: 2;
|
||||||
}
|
|
||||||
|
&:last-of-type {
|
||||||
&:not(.selected) {
|
border-right: 1px solid $tab-border;
|
||||||
background-color: $tab-notselected;
|
}
|
||||||
border-bottom: 1px solid $tab-border;
|
|
||||||
}
|
&:not(.selected) {
|
||||||
|
background-color: $tab-notselected;
|
||||||
span {
|
border-bottom: 1px solid $tab-border;
|
||||||
display: block;
|
/// color
|
||||||
margin: 0 0 .5rem 0;
|
}
|
||||||
}
|
|
||||||
|
span {
|
||||||
}
|
display: block;
|
||||||
[role="tabpanel"] {
|
margin: 0 0 .5rem 0;
|
||||||
background-color: $tab-selected;
|
}
|
||||||
border: 1px solid $tab-border;
|
}
|
||||||
border-top: none;
|
}
|
||||||
padding: 1rem;
|
}
|
||||||
z-index: 1;
|
|
||||||
|
.tab-hidden {
|
||||||
&:not(.open) {
|
display: none;
|
||||||
display: none;
|
}
|
||||||
}
|
|
||||||
@content;
|
[role="tabpanel"] {
|
||||||
|
background-color: $tab-selected;
|
||||||
}
|
border: 1px solid $tab-border;
|
||||||
}
|
border-top: none;
|
||||||
|
padding: 1rem;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&:not(.open) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ block content
|
|||||||
div(tab="scss")
|
div(tab="scss")
|
||||||
+h(3)
|
+h(3)
|
||||||
pre.language-sass.
|
pre.language-sass.
|
||||||
@import "scss/core/tabs/_tabs";
|
@use "scss/core/tabs/_tabs";
|
||||||
@include tabs{
|
@include tabs{
|
||||||
// optional content block
|
// optional content block
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,52 +1 @@
|
|||||||
tabset, .tab-group {
|
.tab-group,tabset{margin:2rem 0 1rem 0}.tab-group [role=tablist],tabset [role=tablist]{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0;padding:0}.tab-group [role=tablist] li.separator,tabset [role=tablist] li.separator{border-bottom:1px solid #7f7f7f;display:inline-block;margin:0.45rem 0 0 0;width:100%}.tab-group [role=tablist] li[role=tab],tabset [role=tablist] li[role=tab]{background-color:#FFF;border-left:1px solid #7f7f7f;border-right:1px solid #7f7f7f;border-radius:0.5rem 0.5rem 0 0;border-top:1px solid #7f7f7f;cursor:pointer;display:inline;margin:0;padding:1rem 1.5rem 0.14rem 1.5rem;z-index:2}.tab-group [role=tablist] li[role=tab]:last-of-type,tabset [role=tablist] li[role=tab]:last-of-type{border-right:1px solid #7f7f7f}.tab-group [role=tablist] li[role=tab]:not(.selected),tabset [role=tablist] li[role=tab]:not(.selected){background-color:#f0f0f0;border-bottom:1px solid #7f7f7f}.tab-group [role=tablist] li[role=tab] span,tabset [role=tablist] li[role=tab] span{display:block;margin:0 0 0.5rem 0}.tab-group .tab-hidden,tabset .tab-hidden{display:none}.tab-group [role=tabpanel],tabset [role=tabpanel]{background-color:#FFF;border:1px solid #7f7f7f;border-top:none;padding:1rem;z-index:1}.tab-group [role=tabpanel]:not(.open),tabset [role=tabpanel]:not(.open){display:none}
|
||||||
margin: 2rem 0 1rem 0;
|
|
||||||
}
|
|
||||||
tabset > ul, .tab-group > ul {
|
|
||||||
display: -webkit-box;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
tabset > ul li.separator, .tab-group > ul li.separator {
|
|
||||||
border-bottom: 1px solid #7f7f7f;
|
|
||||||
border-left: 1px solid #7f7f7f;
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0.45rem 0 0 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
tabset .tab-hidden, .tab-group .tab-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
tabset [role=tab], .tab-group [role=tab] {
|
|
||||||
background-color: #FFF;
|
|
||||||
border-left: 1px solid #7f7f7f;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
border-radius: 0.5rem 0.5rem 0 0;
|
|
||||||
cursor: pointer;
|
|
||||||
margin: 0;
|
|
||||||
display: inline;
|
|
||||||
padding: 1rem 1.5rem 0.14rem 1.5rem;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
tabset [role=tab]:last-of-type, .tab-group [role=tab]:last-of-type {
|
|
||||||
border-right: 1px solid #7f7f7f;
|
|
||||||
}
|
|
||||||
tabset [role=tab]:not(.selected), .tab-group [role=tab]:not(.selected) {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
border-bottom: 1px solid #7f7f7f;
|
|
||||||
}
|
|
||||||
tabset [role=tab] span, .tab-group [role=tab] span {
|
|
||||||
display: block;
|
|
||||||
margin: 0 0 0.5rem 0;
|
|
||||||
}
|
|
||||||
tabset [role=tabpanel], .tab-group [role=tabpanel] {
|
|
||||||
background-color: #FFF;
|
|
||||||
border: 1px solid #7f7f7f;
|
|
||||||
border-top: none;
|
|
||||||
padding: 1rem;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
tabset [role=tabpanel]:not(.open), .tab-group [role=tabpanel]:not(.open) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
|||||||
background: $tooltip-light-background;
|
background: $tooltip-light-background;
|
||||||
border-radius: $tooltip-border-radius;
|
border-radius: $tooltip-border-radius;
|
||||||
color: $tooltip-light-foreground;
|
color: $tooltip-light-foreground;
|
||||||
|
display: none;
|
||||||
filter: $tooltip-light-drop-shadow;
|
filter: $tooltip-light-drop-shadow;
|
||||||
$font-family: $font-body;
|
$font-family: $font-body;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
@@ -47,7 +48,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
will-change: filter;
|
will-change: filter;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
clip-path: inset(50%);
|
clip-path: inset(50%);
|
||||||
clip: rect(1px, 1px, 1px, 1px);
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
@@ -152,6 +153,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
|||||||
:has(> [role="tooltip"]) {
|
:has(> [role="tooltip"]) {
|
||||||
position: relative;
|
position: relative;
|
||||||
&:is(:hover, :focus-visible, :active) > [role="tooltip"] {
|
&:is(:hover, :focus-visible, :active) > [role="tooltip"] {
|
||||||
|
display: block;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition-delay: 300ms;
|
transition-delay: 300ms;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ block content
|
|||||||
div(tab="scss")
|
div(tab="scss")
|
||||||
+h(3)
|
+h(3)
|
||||||
pre.language-sass.
|
pre.language-sass.
|
||||||
@import "scss/core/tooltip/_tooltip";
|
@use "scss/core/tooltip/_tooltip";
|
||||||
@include tooltip;
|
@include tooltip;
|
||||||
+h(4)
|
+h(4)
|
||||||
pre.language-sass
|
pre.language-sass
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@use "../pg/patterns/core/breakpoint/breakpoint";
|
||||||
|
|
||||||
@mixin core-colour-samples {
|
@mixin core-colour-samples {
|
||||||
|
|
||||||
#copystatus {
|
#copystatus {
|
||||||
@@ -48,14 +50,14 @@
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
@include break(-lg) {
|
@include breakpoint.break(-lg) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include break(-sm) {
|
@include breakpoint.break(-sm) {
|
||||||
grid-template-columns: auto;
|
grid-template-columns: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -74,12 +76,12 @@
|
|||||||
"lighter lighter lighter darker darker darker"
|
"lighter lighter lighter darker darker darker"
|
||||||
"notes notes notes notes notes notes";
|
"notes notes notes notes notes notes";
|
||||||
grid-template-columns: repeat(6, 1fr);
|
grid-template-columns: repeat(6, 1fr);
|
||||||
grid-template-rows: repeat(2, 1.5rem) repeat(4, max-content); // 3rem repeat(2, 2rem) 1.5rem repeat(3, max-content);
|
grid-template-rows: repeat(2, 1.5rem) 10rem repeat(3, max-content); // 3rem repeat(2, 2rem) 1.5rem repeat(3, max-content);
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
width: 20rem;
|
width: 20rem;
|
||||||
max-width: 318px;
|
max-width: 318px;
|
||||||
|
|
||||||
@include break(-lg) {
|
@include breakpoint.break(-lg) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
@@ -114,7 +116,7 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
gap: .5rem;
|
gap: .5rem;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-template-rows: repeat(3, max-content);
|
grid-template-rows: 2.5rem repeat(2, max-content);
|
||||||
.result {
|
.result {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
@@ -187,7 +189,7 @@
|
|||||||
padding: .5rem;
|
padding: .5rem;
|
||||||
width: 20rem;
|
width: 20rem;
|
||||||
max-width: 318px;
|
max-width: 318px;
|
||||||
height: max-content;
|
height: 10.5rem;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: .5rem;
|
gap: .5rem;
|
||||||
@@ -230,7 +232,6 @@
|
|||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
place-self: stretch;
|
place-self: stretch;
|
||||||
text-align: center;
|
|
||||||
span {
|
span {
|
||||||
border: none;
|
border: none;
|
||||||
font-size: .9rem;
|
font-size: .9rem;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/* ----------------------------------------------------------
|
||||||
* Variables
|
* Variables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -15,15 +15,26 @@ $tooltip-dark-allow: false;
|
|||||||
// We recommend explicitly using the underscore when referring to pattern scss
|
// We recommend explicitly using the underscore when referring to pattern scss
|
||||||
// as you may have also created a version that compiles to css to display in
|
// as you may have also created a version that compiles to css to display in
|
||||||
// your pattern.
|
// your pattern.
|
||||||
@import "core";
|
@use "core";
|
||||||
|
@use "../../node_modules/prismjs/themes/prism";
|
||||||
|
@use "../../node_modules/prismjs/plugins/toolbar/prism-toolbar";
|
||||||
|
@use "../../node_modules/prismjs/plugins/line-numbers/prism-line-numbers";
|
||||||
|
|
||||||
|
@use "../pg/patterns/core/sticky-note/_sticky-note";
|
||||||
|
@use "../pg/patterns/core/switch/_switch";
|
||||||
|
@use "../pg/patterns/core/tooltip/_tooltip";
|
||||||
|
@use "../pg/patterns/core/breakpoint/_breakpoint";
|
||||||
|
@use "../pg/patterns/core/header/_header";
|
||||||
|
@use "../pg/patterns/core/tabs/_tabs";
|
||||||
|
@use "../pg/patterns/core/status/_status";
|
||||||
|
|
||||||
|
|
||||||
|
@include core.core-colour-samples;
|
||||||
|
@include tooltip.tooltip;
|
||||||
|
@include sticky-note.sticky-note;
|
||||||
|
@include status.status;
|
||||||
|
|
||||||
|
|
||||||
@import "../pg/patterns/core/sticky-note/_sticky-note";
|
|
||||||
@import "../pg/patterns/core/switch/_switch";
|
|
||||||
@import "../pg/patterns/core/tooltip/_tooltip";
|
|
||||||
@import "../pg/patterns/core/breakpoints/_breakpoints";
|
|
||||||
@import "../pg/patterns/core/header/_header";
|
|
||||||
@import "../pg/patterns/core/tabs/_tabs";
|
|
||||||
@import "../pg/patterns/core/status/_status";
|
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -32,19 +43,15 @@ $tooltip-dark-allow: false;
|
|||||||
html {
|
html {
|
||||||
font-family: $font-body;
|
font-family: $font-body;
|
||||||
font-size: $font-size;
|
font-size: $font-size;
|
||||||
@include break(-md) {
|
@include breakpoint.break(-md) {
|
||||||
font-size: calc($font-size + 2pt);
|
font-size: calc($font-size + 2pt);
|
||||||
}
|
}
|
||||||
&.show-breakpoints {
|
&.show-breakpoints {
|
||||||
@include breakpoint-debug;
|
@include breakpoint.debug;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include core-colour-samples;
|
|
||||||
|
|
||||||
@include tooltip;
|
|
||||||
@include sticky-note;
|
|
||||||
@include status;
|
|
||||||
|
|
||||||
article[data-status=deprecated]:not(.show-deprecated) {
|
article[data-status=deprecated]:not(.show-deprecated) {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -65,7 +72,7 @@ body {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
|
||||||
@include header;
|
@include header.header;
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
background-color: var(--colour-blue);
|
background-color: var(--colour-blue);
|
||||||
@@ -84,7 +91,7 @@ body {
|
|||||||
color: var(--colour-white);
|
color: var(--colour-white);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@include break(md-) {
|
@include breakpoint.break(md-) {
|
||||||
display: initial;
|
display: initial;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,7 +105,7 @@ body {
|
|||||||
grid-row: 3;
|
grid-row: 3;
|
||||||
grid-template-columns: auto repeat(2, max-content);
|
grid-template-columns: auto repeat(2, max-content);
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@include switch;
|
@include switch.switch;
|
||||||
label {
|
label {
|
||||||
text-align: left;;
|
text-align: left;;
|
||||||
}
|
}
|
||||||
@@ -109,7 +116,7 @@ body {
|
|||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
grid-row: 4;
|
grid-row: 4;
|
||||||
|
|
||||||
@include break(-md) {
|
@include breakpoint.break(-md) {
|
||||||
grid-row: 3;
|
grid-row: 3;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -117,7 +124,7 @@ body {
|
|||||||
@supports(grid-area: auto) {
|
@supports(grid-area: auto) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1rem repeat(2, auto) 1rem;
|
grid-template-columns: 1rem repeat(2, auto) 1rem;
|
||||||
@include break(md-) {
|
@include breakpoint.break(md-) {
|
||||||
grid-template-columns: auto repeat(2, 22rem) auto;
|
grid-template-columns: auto repeat(2, 22rem) auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,7 +142,7 @@ body {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include tabs {
|
@include tabs.tabs {
|
||||||
pre {
|
pre {
|
||||||
background-color: var(--colour-black-5);
|
background-color: var(--colour-black-5);
|
||||||
font-size: .8rem;
|
font-size: .8rem;
|
||||||
@@ -150,15 +157,12 @@ body {
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: .5rem;
|
grid-gap: .5rem;
|
||||||
grid-template-columns: max-content auto;
|
grid-template-columns: max-content auto;
|
||||||
@include switch;
|
@include switch.switch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep your prism modules
|
|
||||||
@import "../../node_modules/prismjs/themes/prism";
|
|
||||||
@import "../../node_modules/prismjs/plugins/toolbar/prism-toolbar";
|
|
||||||
@import "../../node_modules/prismjs/plugins/line-numbers/prism-line-numbers";
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user