Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfd23cd1a3 | |||
| 37762504a4 | |||
| 1354aac065 | |||
| d3f25a5ef1 | |||
| f7a343b626 | |||
| 162d55a8ce | |||
| 1bb1c297b3 | |||
| 3514094043 | |||
| b6cc236ced | |||
| f78b0a4c63 | |||
| 7bcb45d9bc | |||
| 05fbea8dfd | |||
| e0d62ccc4f | |||
| 2941a5903f | |||
| 857680c3b1 | |||
| b44b17d830 | |||
| 8fe6e39440 | |||
| 5f050066e9 | |||
| 0b5e54faa6 | |||
| 6d8b9d0e47 | |||
| 9db11f3f97 | |||
| df95905fe0 | |||
| 89870edaaf | |||
| ca3f9970a9 | |||
| d5cbcb5807 | |||
| a204f7fc98 | |||
| c6e7b616f1 | |||
| 2a060106bc | |||
| e2c05ac338 | |||
| 93800c2706 | |||
| 67c857bbed | |||
| 516b0fe4df | |||
| b5e0061247 | |||
| a8cd90c349 | |||
| be90329514 | |||
| d64bb5e7a2 | |||
| f842822915 | |||
| c0aa93a3c1 | |||
| 7dcc72d5a0 | |||
| f70d94ea67 | |||
| 339e177ac4 | |||
| 197e6f2f33 | |||
| bcbe51e9a7 | |||
| 559552f218 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.DS_Store
|
||||
ds2 core.sublime-workspace
|
||||
69
Readme.md
69
Readme.md
@@ -1,4 +1,14 @@
|
||||
# DS2 Core
|
||||
# DS2-core
|
||||
DS2-core is a lightweight PugJS-based framework for building design systems.
|
||||
|
||||
The design system compiles to mostly pure HTML, SCSS and JavaScript. There are a few enhanced parts that use PHP in order to handle non-critical tasks Zip files on the fly to collect component JavaScript and SCSS. PugJS is used because it can handle some of the automation such as creating includes making components extremely modular.
|
||||
|
||||
## Requirements
|
||||
The requirements for ds2-core are pretty light. You'll want to be able to process [PugJS](https://pugjs.org/api/getting-started.html) (formerly Jade) and [SCSS](https://sass-lang.com/documentation/) -- and that's about it.
|
||||
|
||||
For our own design system, we use ds2-core with [Prepros](https://prepros.io) (which you can use the Free Unlimited Trial for, but why not splurge and spend the $30USD to support the developer and skip the nags). On MacOS, you could also use [CodeKit](https://codekitapp.com/).
|
||||
|
||||
Alternatively, if you have pre-processor pipelines for Pug and SCSS, which you can install using npm, or any other language you decide to pull in, you can use those to compile if that ends up being easier for you. The framework isn't too picky, so long as things go into the right place.
|
||||
|
||||
## "Installation"
|
||||
|
||||
@@ -11,20 +21,23 @@ src/pg/core/download.php.pug | public
|
||||
|
||||
All other pug files should compile to from src/pg/ to a relative path of public/*
|
||||
|
||||
|
||||
## Running the core
|
||||
|
||||
functions
|
||||
### Callback functions
|
||||
Callback functions can be used in
|
||||
|
||||
beforeArticleLoad - called before any patterns are started to load
|
||||
success - called when loading a pattern is successful if the result is an HTTP 200
|
||||
afterArticleLoad - called after any patterns are started to load
|
||||
done - called when the ajax for any pattern is done, whether successful or not. This is a useful place to load any javascript initializations that pattern.
|
||||
- beforeArticleLoad - called before any patterns have started to load
|
||||
- success - called when loading a pattern is successful if the result is an HTTP 200
|
||||
- afterArticleLoad - called after any patterns have started to load
|
||||
- done - called when the ajax for any pattern is done, whether successful or not. This is a useful place to load any javascript initializations that pattern.
|
||||
|
||||
|
||||
## About the content variable
|
||||
## Creating an item
|
||||
|
||||
The content variable in \_config.pug defines your array of patterns. It is made up of the following attributes:
|
||||
|
||||
## The content object
|
||||
|
||||
The content variable in \/src\/pg\/_config.pug defines your array of patterns. It is made up of the following attributes:
|
||||
- name - the hypenated name of the pattern
|
||||
- status - this should be one of the statuses from your status array
|
||||
- display - (optional) if present this will be displayed, as is, instead of the name
|
||||
@@ -49,6 +62,42 @@ In your design system implementation,
|
||||
|
||||
This will ensure that the .pug file will get processed and the .pp file will be handled as text will get compiled, but they should display correctly and remain in sync while maintaining the minimum number of files.
|
||||
|
||||
## Using core code with your own pattern documentation.
|
||||
Using
|
||||
|
||||
---
|
||||
Creating a new pattern
|
||||
Begin by creating a folder within your strucutre to hold the pattern. Add the folder to your config file.
|
||||
|
||||
|
||||
Generating css
|
||||
You've likely created your component's css as an include file beginning with an underscore. create a second file named the same that includes any dependencies (such as breakpoints) that are required to generate your valid css.
|
||||
|
||||
You can now include the css in your pattern's index file.
|
||||
|
||||
Generating pug
|
||||
Create a custom tool in prepros, give it a name such as "PP to Pug" set the input extension to .pp and the output extension to .pug and check Process Automatically . The command should be
|
||||
Mac / Linux
|
||||
cp {{input}} {{output}}
|
||||
|
||||
Windows
|
||||
copy {{input}} {{output}}
|
||||
|
||||
Once you've added the tool, set the output to "relative path" and set the output extension to pug. For each .pp file you may have to check process automatically as it doesn't always identify the new extension.
|
||||
|
||||
You will now be able to include the .pp file in your pattern's index file while including the .pug file which will give a compiled version of your component's html.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
## 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).
|
||||
|
||||
@@ -1,651 +0,0 @@
|
||||
{
|
||||
"auto_complete":
|
||||
{
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"Quer",
|
||||
"querySelectorAll"
|
||||
],
|
||||
[
|
||||
"get",
|
||||
"getAttribute"
|
||||
],
|
||||
[
|
||||
"query",
|
||||
"querySelectorAll"
|
||||
],
|
||||
[
|
||||
"to",
|
||||
"toContent"
|
||||
],
|
||||
[
|
||||
"tos",
|
||||
"toSentenceCase"
|
||||
],
|
||||
[
|
||||
"sticky",
|
||||
"sticky-note"
|
||||
],
|
||||
[
|
||||
"back",
|
||||
"background-color"
|
||||
],
|
||||
[
|
||||
"setAttr",
|
||||
"setAttributes"
|
||||
],
|
||||
[
|
||||
"post",
|
||||
"positionSticky"
|
||||
],
|
||||
[
|
||||
"grid-",
|
||||
"grid-column"
|
||||
],
|
||||
[
|
||||
"of",
|
||||
"offsetWidth"
|
||||
],
|
||||
[
|
||||
"fun",
|
||||
"function"
|
||||
],
|
||||
[
|
||||
"grid-template",
|
||||
"grid-template-columns"
|
||||
],
|
||||
[
|
||||
"text",
|
||||
"text-decoration"
|
||||
],
|
||||
[
|
||||
"text-",
|
||||
"text-decoration"
|
||||
],
|
||||
[
|
||||
"grid-template-",
|
||||
"grid-template-columns"
|
||||
],
|
||||
[
|
||||
"bakc",
|
||||
"background-color"
|
||||
],
|
||||
[
|
||||
"copyco",
|
||||
"copycolour"
|
||||
],
|
||||
[
|
||||
"ar",
|
||||
"article"
|
||||
],
|
||||
[
|
||||
"toS",
|
||||
"toSentenceCase"
|
||||
],
|
||||
[
|
||||
"bacg",
|
||||
"background-color"
|
||||
],
|
||||
[
|
||||
"acc",
|
||||
"accent-grey"
|
||||
],
|
||||
[
|
||||
"_",
|
||||
"_POST"
|
||||
],
|
||||
[
|
||||
"json",
|
||||
"json_encode"
|
||||
],
|
||||
[
|
||||
"font",
|
||||
"font-heading"
|
||||
],
|
||||
[
|
||||
"border",
|
||||
"border-radius"
|
||||
],
|
||||
[
|
||||
"background-o",
|
||||
"background-position"
|
||||
],
|
||||
[
|
||||
"lang",
|
||||
"language\tAttr"
|
||||
],
|
||||
[
|
||||
"Emai",
|
||||
"EMAIL_FOLDER"
|
||||
],
|
||||
[
|
||||
"tem",
|
||||
"template"
|
||||
],
|
||||
[
|
||||
"G",
|
||||
"GetParentFolderName"
|
||||
],
|
||||
[
|
||||
"out",
|
||||
"outFile"
|
||||
],
|
||||
[
|
||||
"with",
|
||||
"With"
|
||||
],
|
||||
[
|
||||
"Write",
|
||||
"WriteFile"
|
||||
],
|
||||
[
|
||||
"File",
|
||||
"FileExists"
|
||||
],
|
||||
[
|
||||
"font-",
|
||||
"font-weight"
|
||||
],
|
||||
[
|
||||
"list-st",
|
||||
"list-style-type"
|
||||
],
|
||||
[
|
||||
"html",
|
||||
"html5\tSimple HTML5 Boilerplate"
|
||||
],
|
||||
[
|
||||
"backgroun",
|
||||
"background-color"
|
||||
],
|
||||
[
|
||||
"background-",
|
||||
"background-color"
|
||||
],
|
||||
[
|
||||
"place",
|
||||
"place_content"
|
||||
],
|
||||
[
|
||||
"string",
|
||||
"stringify"
|
||||
],
|
||||
[
|
||||
"cor",
|
||||
"corpbiege"
|
||||
],
|
||||
[
|
||||
"inner",
|
||||
"innerWidth"
|
||||
],
|
||||
[
|
||||
"program",
|
||||
"programcontent"
|
||||
],
|
||||
[
|
||||
"corp",
|
||||
"corpgreen"
|
||||
]
|
||||
]
|
||||
},
|
||||
"buffers":
|
||||
[
|
||||
{
|
||||
"file": "src/js/scaffolding.js",
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 2622,
|
||||
"line_ending": "Unix"
|
||||
},
|
||||
"undo_stack":
|
||||
[
|
||||
[
|
||||
1,
|
||||
1,
|
||||
"revert",
|
||||
null,
|
||||
"AgAAAAAAAAAAAAAAAAAAAAAAAAA+CgAALy8gY29yZSBhbmQgcHJpc20KaW1wb3J0ICogYXMgY29yZSBmcm9tICcuL2NvcmUvX2NvcmUuanMnOwppbXBvcnQgKiBhcyBQcmlzbSBmcm9tICIuLi8uLi9ub2RlX21vZHVsZXMvcHJpc21qcy9wcmlzbSI7CmltcG9ydCAiLi4vLi4vbm9kZV9tb2R1bGVzL3ByaXNtanMvcGx1Z2lucy9saW5lLW51bWJlcnMvcHJpc20tbGluZS1udW1iZXJzIjsKaW1wb3J0ICIuLi8uLi9ub2RlX21vZHVsZXMvcHJpc21qcy9wbHVnaW5zL3Rvb2xiYXIvcHJpc20tdG9vbGJhciI7CmltcG9ydCAnLi4vLi4vbm9kZV9tb2R1bGVzL3ByaXNtanMvY29tcG9uZW50cy9wcmlzbS1qc29uJzsKaW1wb3J0ICcuLi8uLi9ub2RlX21vZHVsZXMvcHJpc21qcy9jb21wb25lbnRzL3ByaXNtLXB1Zyc7CmltcG9ydCAnLi4vLi4vbm9kZV9tb2R1bGVzL3ByaXNtanMvY29tcG9uZW50cy9wcmlzbS1zYXNzJzsKCi8vIGltcG9ydCBwYXR0ZXJuIHN0dWZmLgppbXBvcnQgKiBhcyBzdGlja3lub3RlIGZyb20gIi4uL3BnL3BhdHRlcm5zL2NvcmUvc3RpY2t5LW5vdGUvX3N0aWNreS1ub3RlLmpzIjsKaW1wb3J0ICogYXMgc3d0Y2ggICAgICBmcm9tICIuLi9wZy9wYXR0ZXJucy9jb3JlL3N3aXRjaC9fc3dpdGNoLmpzIjsKaW1wb3J0ICogYXMgdGFicyAgICAgICBmcm9tICIuLi9wZy9wYXR0ZXJucy9jb3JlL3RhYnMvX3RhYnMuanMiOwoKLy8gaW5pdCBjb3JlCmNvcmUuaW5pdCh7CglzdWNjZXNzOiAoYSkgPT4geyAKCQl0YWJzLmluaXQoYSk7CgkJc3d0Y2guaW5pdChhKTsKCQlzdGlja3lub3RlLmluaXQoYSk7Cgl9LAoJbm90Rm91bmQ6IChhLCBwYXRoKSA9PiB7CgkJYS5pbm5lckhUTUwgPSBgJHthLmlubmVySFRNTH08ZGl2IGNsYXNzPSdub3RpZmljYXRpb24tYm94IGVycm9yJz48cD5UaGlzIHBhdHRlcm4gYXBwZWFycyB0byBiZSBtaXNzaW5nLjxicj48c21hbGw+KCR7cGF0aH0gcmV0dXJuZWQgaHR0cCBzdGF0dXMgNDA0KTwvc21hbGw+PC9wPjwvZGl2PmA7Cgl9Cn0pOwoKLy8gZGVwcmVjYXRlZCBzd2l0Y2ggaGFuZGxlcgpjb25zdCBmbGlwSW5mb1N3aXRjaCA9IChlLCBzID0gZS5jdXJyZW50VGFyZ2V0KSA9PiB7CgkKCXN3aXRjaChzLmdldEF0dHJpYnV0ZSgiaWQiKSkgewoKCQljYXNlICJkZXByZWNhdGVkIiA6IAoJCQljb3JlLmNvb2tpZS5zZXQoInNob3ctZGVwcmVjYXRlZCIsIHMuZ2V0QXR0cmlidXRlKCJhcmlhLWNoZWNrZWQiKSwgMzAsICIvIik7CgkJCWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIm1haW4iKS5xdWVyeVNlbGVjdG9yQWxsKCJhcnRpY2xlW2RhdGEtc3RhdHVzPWRlcHJlY2F0ZWRdIikuZm9yRWFjaCgoYSkgPT4gewoJCQkJYS5jbGFzc0xpc3RbKCBzLmdldEF0dHJpYnV0ZSgiYXJpYS1jaGVja2VkIikgPT0gInRydWUiID8gImFkZCIgOiAicmVtb3ZlIiApXSgic2hvdy1kZXByZWNhdGVkIik7CgkJCX0pOwoJCWJyZWFrOyAKCgkJY2FzZSAiYnJlYWtwb2ludHMiIDoKCQkJY29uc29sZS5sb2coImhlcmUiKQoJCQljb3JlLmNvb2tpZS5zZXQoInNob3ctYnJlYWtwb2ludHMiLCBzLmdldEF0dHJpYnV0ZSgiYXJpYS1jaGVja2VkIiksIDMwLCAiLyIpOwoJCQlkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJodG1sIikuY2xhc3NMaXN0Wyggcy5nZXRBdHRyaWJ1dGUoImFyaWEtY2hlY2tlZCIpID09ICJ0cnVlIiA/ICJhZGQiIDogInJlbW92ZSIgKV0oInNob3ctYnJlYWtwb2ludHMiKTsKCQlicmVhazsgCgl9Cgp9CgovLyBjcmVhdGUgYSBwdXJlIEpTIG1vdXNlIGNsaWNrIGV2ZW50CmNvbnN0IGNsaWNrID0gbmV3IE1vdXNlRXZlbnQoJ2NsaWNrJywgewoJdmlldzogd2luZG93LAoJYnViYmxlczogZmFsc2UsCgljYW5jZWxhYmxlOiB0cnVlCn0pOwoKLy8gZ2V0IHRoZSBzd2l0Y2gsIGluaXRpYWxpemUgaXQgYW5kIGFkZCB0aGUgaGFuZGxlcgpsZXQgc3dpdGNoZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIuaW5mby1zd2l0Y2hlcyIpOwpzd3RjaC5pbml0KHN3aXRjaGVzKTsKCmxldCBkZXByZWNhdGVkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI2RlcHJlY2F0ZWQiKTsKbGV0IGJyZWFrcG9pbnRzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI2JyZWFrcG9pbnRzIik7CgpkZXByZWNhdGVkLm9uY2xpY2sgPSBmbGlwSW5mb1N3aXRjaDsKZGVwcmVjYXRlZC5rZXlwcmVzcyA9IGZsaXBJbmZvU3dpdGNoOwpicmVha3BvaW50cy5vbmNsaWNrID0gZmxpcEluZm9Td2l0Y2g7CmJyZWFrcG9pbnRzLmtleXByZXNzID0gZmxpcEluZm9Td2l0Y2g7CgovLyBjaGVjayBhIGNvb2tpZSB0byBnZXQgdGhlIHN3aXRjaCdzIHN0YXRlCmlmIChjb3JlLmNvb2tpZS5nZXQoInNob3ctZGVwcmVjYXRlZCIpID09ICJ0cnVlIikgewoJZGVwcmVjYXRlZC5kaXNwYXRjaEV2ZW50KGNsaWNrKTsKfQppZiAoY29yZS5jb29raWUuZ2V0KCJzaG93LWJyZWFrcG9pbnRzIikgPT0gInRydWUiKSB7CglicmVha3BvaW50cy5kaXNwYXRjaEV2ZW50KGNsaWNrKTsKfQoKLy8ganVzdCBmb3IgZnVuLi4uIFdlJ2xsIHNob3cgZGVwcmVjYXRlZCBpZiB0aGV5IG1hdGNoIHRoZSBwYXRoCi8vIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoYCMke2NvcmUudXJsLnAucmVwbGFjZSgvXC8vZywgIi0iKX1gKS5jbGFzc0xpc3QuYWRkKCJzaG93LWRlcHJlY2F0ZWQiKTsKAAAAAAAAAAA+CgAAAAAAAAAAAAA",
|
||||
"AQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"build_system": "",
|
||||
"build_system_choices":
|
||||
[
|
||||
],
|
||||
"build_varint": "",
|
||||
"command_palette":
|
||||
{
|
||||
"height": 89.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"key",
|
||||
"Preferences: Key Bindings"
|
||||
],
|
||||
[
|
||||
"live",
|
||||
"MarkdownLivePreview: Open Preview"
|
||||
],
|
||||
[
|
||||
"markdown",
|
||||
"MarkdownLivePreview: Open Settings"
|
||||
],
|
||||
[
|
||||
"install",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"packages",
|
||||
"Package Control: Discover Packages"
|
||||
],
|
||||
[
|
||||
"Package Control: ",
|
||||
"Package Control: Discover Packages"
|
||||
],
|
||||
[
|
||||
"insta",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"Package Control: install",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"package",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"compare",
|
||||
"Compare with..."
|
||||
],
|
||||
[
|
||||
"install\t",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"list",
|
||||
"Package Control: List Packages"
|
||||
],
|
||||
[
|
||||
"jav",
|
||||
"Set Syntax: JavaScript"
|
||||
],
|
||||
[
|
||||
"diff",
|
||||
"Set Syntax: Diff"
|
||||
]
|
||||
],
|
||||
"width": 444.0
|
||||
},
|
||||
"console":
|
||||
{
|
||||
"height": 0.0,
|
||||
"history":
|
||||
[
|
||||
]
|
||||
},
|
||||
"distraction_free":
|
||||
{
|
||||
"menu_visible": true,
|
||||
"show_minimap": false,
|
||||
"show_open_files": false,
|
||||
"show_tabs": false,
|
||||
"side_bar_visible": false,
|
||||
"status_bar_visible": false
|
||||
},
|
||||
"expanded_folders":
|
||||
[
|
||||
"/Users/am/Desktop/ds2-core",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core"
|
||||
],
|
||||
"file_history":
|
||||
[
|
||||
"/Users/am/Desktop/ds2-core/src/js/core/_core.js",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/components/switch/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/components/sticky-note/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/layouts/breakpoints/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/layouts/header/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/layouts/tabs/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/components/tooltip/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/status/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/core/colours/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/core/_master-index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/_config.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/components/sticky-note-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/components/switch-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/components/tooltip-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/layouts/breakpoints-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/layouts/header-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/layouts/tabs-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/status-core/index.pug",
|
||||
"/Users/am/Desktop/ds2-core/src/pg/patterns/colours-core/index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/components/sticky-note-core/_sticky-note.js",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/tabs-core/_tabs.js",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/_master-index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/_config.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/scss/scaffolding.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/js/scaffolding.js",
|
||||
"/Users/am/Desktop/ds2 core/src/js/_core.js",
|
||||
"/Users/am/Desktop/ds2 core/public/assets/scaffolding-min.js",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/header-core/_header.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/header-core/_header.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/header-core/header.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/components/tooltip-core/_tooltip.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/components/tooltip-core/tooltip.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/components/switch-core/_switch.js",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/components/sticky-note-core/sticky-note.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/components/sticky-note-core/_sticky-note.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/colours-core/index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/_color-samples.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/tabs-core/tabs.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/breakpoints-core/_breakpoints.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/tabs-core/_tabs-jquery.js",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/tabs-core/index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/tabs-core/_tabs.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/tabs-core/_tabs.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/scss/_color-samples.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/js/_color-samples.js",
|
||||
"/Users/am/Desktop/ds2 core/public/assets/scaffolding.css",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/status-core/_status.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/status-core/index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/patterns/layouts/header-core/index.pug",
|
||||
"/Users/am/Desktop/ds2 core/src/js/_geturlvars.js",
|
||||
"/Users/am/Desktop/ds2 core/src/js/_core-cookies.js",
|
||||
"/Users/am/Desktop/My DS2/src/js/scaffolding.js",
|
||||
"/Users/am/Desktop/ds2 core/Readme.md",
|
||||
"/Users/am/Desktop/My DS2/src/scss/_color-samples.scss",
|
||||
"/Users/am/Desktop/My DS2/src/scss/scaffolding.scss",
|
||||
"/Users/am/Desktop/My DS2/public/assets/scaffolding.css",
|
||||
"/Users/am/Desktop/My DS2/src/pg/_config.pug",
|
||||
"/Users/am/Desktop/My DS2/src/scss/_core.scss",
|
||||
"/Users/am/Desktop/ds2 core/src/pg/_core.scss.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/_master-pattern.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/_color-samples.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/other-docs/status/index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/_core.scss.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/_master-index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/visual-design/spacing/index.pug",
|
||||
"/Users/am/Desktop/statuses.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/sticky-note/_sticky-note.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/sticky-note/_sticky-note.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/sticky-note/index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/js/_oneClickSelect.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/_tabs.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/_tabs-module.js",
|
||||
"/Users/am/Desktop/tabs-module-old.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/esc6 tabs.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/tabs-module.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/_tabs.scss",
|
||||
"/Users/am/Desktop/My DS2/public/assets/scaffolding-min.js",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/tabs.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/sticky-note/sticky-note.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/form-fields/text/index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/other-docs/flex-box/_flex-box.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/other-docs/grid/_grid.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/_config.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/button/_button.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/text/_text.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/text/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/_form-fields.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/textarea/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/textarea/_textarea.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/button/button.css",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/form-fields.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/form-fields/button/button.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/form-fields/button/index.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/form-fields/text/text.pug",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/form-fields/text/text.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/form-fields/form-fields.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/progress-bar/_progress-bar.scss",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/components/form-fields/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/scss/scaffolding.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/sticky-note/_sticky-note.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/sticky-note/_sticky-note.js",
|
||||
"/Users/am/Desktop/my DS2/src/js/scaffolding.js",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/layouts/main-navigation/_main-navigation.js",
|
||||
"/Users/am/Desktop/my DS2/src/pg/_core.scss.pug",
|
||||
"/Users/am/Desktop/my DS2/public/assets/scaffolding.css",
|
||||
"/Users/am/Desktop/My DS2/src/pg/patterns/layouts/tabs/_tabs.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/_color-samples.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/layouts/tabs/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/spacing/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/spacing/_spacing.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/typography/_content.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/spacing/spacing.scss",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/typography/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/site-identifiers/favicon-and-browser-tab/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/site-identifiers/monogram/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/switch/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/tooltip/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/link/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/components/progress-bar/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/layouts/main-navigation/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/layouts/breakpoints/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/notifications/index.pug",
|
||||
"/Users/am/Desktop/my DS2/src/pg/patterns/visual-design/spacing/spacing.css"
|
||||
],
|
||||
"find":
|
||||
{
|
||||
"height": 24.0
|
||||
},
|
||||
"find_in_files":
|
||||
{
|
||||
"height": 179.0,
|
||||
"where_history":
|
||||
[
|
||||
"<open files>"
|
||||
]
|
||||
},
|
||||
"find_state":
|
||||
{
|
||||
"case_sensitive": false,
|
||||
"find_history":
|
||||
[
|
||||
"../core/_master-pattern.pug",
|
||||
"../core",
|
||||
"hide-deprecated",
|
||||
"deprecated",
|
||||
"ajx",
|
||||
"console.log",
|
||||
"setupStickies",
|
||||
"document.querySelector",
|
||||
"renderPatterns",
|
||||
"xhr",
|
||||
"xhttp",
|
||||
"document.querySelector",
|
||||
"classList",
|
||||
"core.",
|
||||
"innerHTML",
|
||||
"core.",
|
||||
"generateSCSS",
|
||||
"showMessage(",
|
||||
"core.showMessage",
|
||||
"core.colours",
|
||||
"core.colors",
|
||||
"status-",
|
||||
"header",
|
||||
"status:",
|
||||
"status",
|
||||
"core: \"true\",",
|
||||
"1rem",
|
||||
"main-grid-4col",
|
||||
"@include main-grid-4col;",
|
||||
"components",
|
||||
"layouts",
|
||||
"alert",
|
||||
"colour",
|
||||
"main-grid",
|
||||
"{\n\t\t\t\t\tname: \"header\",\n\t\t\t\t\tstatus: \"complete\",\n\t\t\t\t\tcore: true,\n\t\t\t\t}, ",
|
||||
"colours",
|
||||
"get.vars.",
|
||||
"get.",
|
||||
"colours.",
|
||||
"cookie.get",
|
||||
"cookie.set",
|
||||
"cookie",
|
||||
"function"
|
||||
],
|
||||
"highlight": false,
|
||||
"in_selection": false,
|
||||
"preserve_case": false,
|
||||
"regex": false,
|
||||
"replace_history":
|
||||
[
|
||||
"../../core/_master-pattern.pug",
|
||||
"colors",
|
||||
"core.cookie.get",
|
||||
"core.cookie.set"
|
||||
],
|
||||
"reverse": false,
|
||||
"scrollbar_highlights": true,
|
||||
"show_context": true,
|
||||
"use_buffer2": true,
|
||||
"use_gitignore": true,
|
||||
"whole_word": false,
|
||||
"wrap": false
|
||||
},
|
||||
"groups":
|
||||
[
|
||||
{
|
||||
"sheets":
|
||||
[
|
||||
{
|
||||
"buffer": 0,
|
||||
"file": "src/js/scaffolding.js",
|
||||
"selected": true,
|
||||
"semi_transient": false,
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 2622,
|
||||
"regions":
|
||||
{
|
||||
},
|
||||
"selection":
|
||||
[
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"settings":
|
||||
{
|
||||
"syntax": "Packages/JavaScript/JavaScript.sublime-syntax",
|
||||
"tab_size": 4,
|
||||
"translate_tabs_to_spaces": false
|
||||
},
|
||||
"translation.x": 0.0,
|
||||
"translation.y": 365.0,
|
||||
"zoom_level": 1.0
|
||||
},
|
||||
"stack_index": 0,
|
||||
"stack_multiselect": false,
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"incremental_find":
|
||||
{
|
||||
"height": 24.0
|
||||
},
|
||||
"input":
|
||||
{
|
||||
"height": 209.0
|
||||
},
|
||||
"layout":
|
||||
{
|
||||
"cells":
|
||||
[
|
||||
[
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1
|
||||
]
|
||||
],
|
||||
"cols":
|
||||
[
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"rows":
|
||||
[
|
||||
0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"menu_visible": true,
|
||||
"output.diff_views":
|
||||
{
|
||||
"height": 339.0
|
||||
},
|
||||
"output.exec":
|
||||
{
|
||||
"height": 147.0
|
||||
},
|
||||
"output.find_results":
|
||||
{
|
||||
"height": 0.0
|
||||
},
|
||||
"pinned_build_system": "",
|
||||
"project": "ds2 core.sublime-project",
|
||||
"replace":
|
||||
{
|
||||
"height": 44.0
|
||||
},
|
||||
"save_all_on_build": false,
|
||||
"select_file":
|
||||
{
|
||||
"height": 0.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
],
|
||||
"width": 0.0
|
||||
},
|
||||
"select_project":
|
||||
{
|
||||
"height": 500.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"",
|
||||
"D:\\Projects\\apps\\Apps Website.sublime-project"
|
||||
]
|
||||
],
|
||||
"width": 380.0
|
||||
},
|
||||
"select_symbol":
|
||||
{
|
||||
"height": 274.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
],
|
||||
"width": 592.0
|
||||
},
|
||||
"selected_group": 0,
|
||||
"settings":
|
||||
{
|
||||
},
|
||||
"show_minimap": false,
|
||||
"show_open_files": true,
|
||||
"show_tabs": true,
|
||||
"side_bar_visible": true,
|
||||
"side_bar_width": 254.0,
|
||||
"status_bar_visible": true,
|
||||
"template_settings":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -354,17 +354,6 @@
|
||||
"keep_fnames": false,
|
||||
"safari10": false
|
||||
},
|
||||
"node-sass": {
|
||||
"indentType": "space",
|
||||
"allowWildcardImports": false,
|
||||
"indentWidth": 2,
|
||||
"linefeed": "lf",
|
||||
"outputStyle": "expanded",
|
||||
"precision": 10,
|
||||
"sourceMap": false,
|
||||
"removeCharset": false,
|
||||
"sourceComments": false
|
||||
},
|
||||
"png": {
|
||||
"quality": 90
|
||||
},
|
||||
@@ -442,6 +431,17 @@
|
||||
"turf": {
|
||||
"rootDir": ""
|
||||
},
|
||||
"node-sass": {
|
||||
"indentType": "space",
|
||||
"allowWildcardImports": false,
|
||||
"indentWidth": 2,
|
||||
"linefeed": "lf",
|
||||
"outputStyle": "expanded",
|
||||
"precision": 10,
|
||||
"sourceMap": false,
|
||||
"removeCharset": false,
|
||||
"sourceComments": false
|
||||
},
|
||||
"typescript": {
|
||||
"allowJs": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
@@ -516,7 +516,7 @@
|
||||
},
|
||||
{
|
||||
"task": "minify-css",
|
||||
"enable": true
|
||||
"enable": false
|
||||
}
|
||||
],
|
||||
"output": {
|
||||
@@ -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",
|
||||
"config": {
|
||||
|
||||
292
public/assets/scaffolding-min.js
vendored
292
public/assets/scaffolding-min.js
vendored
@@ -30,7 +30,7 @@ String.prototype.toPath = function () {
|
||||
var font = {
|
||||
size: 0
|
||||
};
|
||||
var copyColourFallback = function copyColourFallback(copyInfo, attr) {
|
||||
var copyFallback = function copyFallback(copyInfo, attr) {
|
||||
console.log("fallback");
|
||||
var textArea = document.createElement('textarea');
|
||||
textArea.value = copyInfo;
|
||||
@@ -75,22 +75,6 @@ var showMessage = function showMessage(m, s) {
|
||||
status.remove();
|
||||
}, 1000);
|
||||
};
|
||||
var oneClickSelect = function oneClickSelect(e) {
|
||||
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : e.currentTarget;
|
||||
// In here, "this" is the element
|
||||
var range, selection;
|
||||
if (window.getSelection) {
|
||||
selection = window.getSelection();
|
||||
range = document.createRange();
|
||||
range.selectNodeContents(t);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
} else if (document.body.createTextRange) {
|
||||
range = document.body.createTextRange();
|
||||
range.moveToElementText(t);
|
||||
range.select();
|
||||
}
|
||||
};
|
||||
var getURLVars = function getURLVars() {
|
||||
var oResult = {};
|
||||
if (location.search.length > 0) {
|
||||
@@ -144,8 +128,24 @@ module.exports = {
|
||||
}
|
||||
return "";
|
||||
},
|
||||
remove: function remove(cnane) {
|
||||
setCookie(cname, "", -1);
|
||||
remove: function remove(cname) {
|
||||
module.exports.cookie.set(cname, null, new Date(null));
|
||||
}
|
||||
},
|
||||
oneClickSelect: function oneClickSelect(e) {
|
||||
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : e.currentTarget;
|
||||
// In here, "this" is the element
|
||||
var range, selection;
|
||||
if (window.getSelection) {
|
||||
selection = window.getSelection();
|
||||
range = document.createRange();
|
||||
range.selectNodeContents(t);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
} else if (document.body.createTextRange) {
|
||||
range = document.body.createTextRange();
|
||||
range.moveToElementText(t);
|
||||
range.select();
|
||||
}
|
||||
},
|
||||
colour: {
|
||||
@@ -156,10 +156,10 @@ module.exports = {
|
||||
navigator.clipboard.writeText(c).then(function () {
|
||||
showMessage("Copied ".concat(w, "."));
|
||||
}, function (e) {
|
||||
copyColourFallback(c, w);
|
||||
copyFallback(c, w);
|
||||
});
|
||||
} else {
|
||||
copyColourFallback(c, w);
|
||||
copyFallback(c, w);
|
||||
}
|
||||
},
|
||||
positionTooltip: function positionTooltip() {
|
||||
@@ -174,9 +174,25 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
},
|
||||
// getCSS: (el, prop, b = false) {
|
||||
// return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
// },
|
||||
getCSS: function getCSS(el, prop) {
|
||||
var b = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
},
|
||||
getTabPath: function getTabPath(t) {
|
||||
var url = window.location.toString();
|
||||
url = url.indexOf("?") > 0 ? url.substring(0, url.indexOf("?")) : url;
|
||||
url = "".concat(url, "?p=").concat(t.closest("article").getAttribute("data-path"), "#").concat(t.getAttribute("id"));
|
||||
var type = "URL";
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(url).then(function () {
|
||||
showMessage("Copied ".concat(type, "."));
|
||||
}, function (e) {
|
||||
copyFallback(url, type);
|
||||
});
|
||||
} else {
|
||||
copyFallback(url, type);
|
||||
}
|
||||
},
|
||||
init: function init() {
|
||||
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var url = getURLVars();
|
||||
@@ -204,11 +220,6 @@ module.exports = {
|
||||
var observer = new IntersectionObserver(function (articles) {
|
||||
articles.forEach(function (article) {
|
||||
var a = article.target;
|
||||
|
||||
// console.log("observing: ", { id: a.getAttribute("id"), intersecting: a.isIntersecting } )
|
||||
// if (article.intersectionRatio > 0) {
|
||||
// console.log("Is interesecting: ", { id: article.target.getAttribute("id"), intersecting: article.isIntersecting, ratio: article.intersectionRatio } )
|
||||
|
||||
if (article.isIntersecting == true) {
|
||||
var path = a.getAttribute("data-path");
|
||||
path = "patterns/" + (a.getAttribute("data-core") == "true" ? "core/" + path.substring(path.lastIndexOf("/") + 1) : a.getAttribute("data-path")) + "/index.html";
|
||||
@@ -242,7 +253,7 @@ module.exports = {
|
||||
Prism.highlightAll();
|
||||
a.querySelectorAll("code").forEach(function (c) {
|
||||
c.onclick = function (e) {
|
||||
oneClickSelect(e);
|
||||
module.exports.oneClickSelect(e);
|
||||
};
|
||||
});
|
||||
module.exports.colour.positionTooltip();
|
||||
@@ -3003,13 +3014,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
||||
|
||||
/***/ }),
|
||||
/* 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 _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; } }
|
||||
@@ -3111,35 +3117,37 @@ var calculateStickyPosition = function calculateStickyPosition(s) {
|
||||
});
|
||||
}
|
||||
};
|
||||
function init() {
|
||||
var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px", ""));
|
||||
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 () {
|
||||
module.exports = {
|
||||
init: function init() {
|
||||
var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px", ""));
|
||||
var stickies = p.querySelectorAll("sticky-note");
|
||||
stickies.forEach(function (s) {
|
||||
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", ""));
|
||||
var stickies = p.querySelectorAll("sticky-note");
|
||||
stickies.forEach(function (s) {
|
||||
calculateStickyPosition(s);
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
/* 9 */
|
||||
@@ -3163,13 +3171,17 @@ function flip(e) {
|
||||
module.exports = {
|
||||
init: function init() {
|
||||
var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
||||
p.querySelectorAll("[role='switch']").forEach(function (sw) {
|
||||
sw.innerHTML = "<span></span>";
|
||||
sw.setAttribute("aria-checked", "false");
|
||||
sw.setAttribute("tabindex", "0");
|
||||
sw.addEventListener("click", flip, false);
|
||||
sw.addEventListener("keypress", flip, false);
|
||||
});
|
||||
try {
|
||||
p.querySelectorAll("[role='switch']").forEach(function (sw) {
|
||||
sw.innerHTML = "<span></span>";
|
||||
sw.setAttribute("aria-checked", "false");
|
||||
sw.setAttribute("tabindex", "0");
|
||||
sw.addEventListener("click", flip, false);
|
||||
sw.addEventListener("keypress", flip, false);
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn("Cannot initialise switches.", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3192,49 +3204,123 @@ var click = new MouseEvent('click', {
|
||||
bubbles: false,
|
||||
cancelable: true
|
||||
});
|
||||
var waitForElement = function waitForElement(selector) {
|
||||
return new Promise(function (resolve) {
|
||||
if (document.querySelector(selector)) {
|
||||
return resolve(document.querySelector(selector));
|
||||
}
|
||||
var observer = new MutationObserver(function (mutations) {
|
||||
if (document.querySelector(selector)) {
|
||||
observer.disconnect();
|
||||
resolve(document.querySelector(selector));
|
||||
}
|
||||
});
|
||||
|
||||
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
});
|
||||
};
|
||||
var chooseTab = function chooseTab(tab) {
|
||||
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);
|
||||
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;
|
||||
function init() {
|
||||
var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
||||
var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(function (tabGroup) {
|
||||
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) {
|
||||
var tab = child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||
// 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();
|
||||
var tabPanel = document.createElement('div');
|
||||
|
||||
// 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));
|
||||
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>");
|
||||
tablist += "<li tabindex=\"0\" role=\"tab\" 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 = s != true ? "".concat(tablist) : "".concat(tablist, "<li role=\"separator\" class=\"separator\"></li>");
|
||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||
ul.innerHTML = spacer != true ? "".concat(tablist) : "".concat(tablist, "<li role=\"separator\" class=\"separator\"></li>");
|
||||
if (tabGroup.hasAttribute("order") || tabGroup.hasAttribute("data-order")) {
|
||||
var order = (tabGroup.getAttribute("order") || tabGroup.getAttribute("data-order")).split(",");
|
||||
var items = Array.from(ul.getElementsByTagName("li"));
|
||||
items.sort(function (a, b) {
|
||||
console.log("here");
|
||||
var aa = order.indexOf(a.textContent.trim());
|
||||
var bb = order.indexOf(b.textContent.trim());
|
||||
|
||||
// Check if both items exist in orderArray
|
||||
if (aa === -1) return 1; // Move to the end if not found
|
||||
if (bb === -1) return -1; // Move to the end if not found
|
||||
|
||||
return aa - bb; // Sort based on the defined order
|
||||
});
|
||||
ul.innerHTML = '';
|
||||
items.forEach(function (item) {
|
||||
return ul.appendChild(item);
|
||||
});
|
||||
}
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(function (tab) {
|
||||
tab.addEventListener("click", function () {
|
||||
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("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();
|
||||
@@ -3243,6 +3329,22 @@ function init() {
|
||||
}
|
||||
});
|
||||
});
|
||||
ul.querySelector("li").classList.add("selected");
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3348,6 +3450,7 @@ __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___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___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___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);
|
||||
@@ -3365,10 +3468,12 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
// init core
|
||||
// init c
|
||||
_core_core_js__WEBPACK_IMPORTED_MODULE_0__.init({
|
||||
success: function success(a) {
|
||||
_pg_patterns_core_tabs_tabs_js__WEBPACK_IMPORTED_MODULE_9__.init(a);
|
||||
_pg_patterns_core_tabs_tabs_js__WEBPACK_IMPORTED_MODULE_9__.init(a, true, {
|
||||
shiftModifier: _core_core_js__WEBPACK_IMPORTED_MODULE_0__.getTabPath
|
||||
});
|
||||
_pg_patterns_core_switch_switch_js__WEBPACK_IMPORTED_MODULE_8__.init(a);
|
||||
_pg_patterns_core_sticky_note_sticky_note_js__WEBPACK_IMPORTED_MODULE_7__.init(a);
|
||||
},
|
||||
@@ -3388,7 +3493,6 @@ var flipInfoSwitch = function flipInfoSwitch(e) {
|
||||
});
|
||||
break;
|
||||
case "breakpoints":
|
||||
console.log("here");
|
||||
_core_core_js__WEBPACK_IMPORTED_MODULE_0__.cookie.set("show-breakpoints", s.getAttribute("aria-checked"), 30, "/");
|
||||
document.querySelector("html").classList[s.getAttribute("aria-checked") == "true" ? "add" : "remove"]("show-breakpoints");
|
||||
break;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -24,7 +24,7 @@
|
||||
return $result;
|
||||
}
|
||||
|
||||
$allowed_types = ["scss", "js"];
|
||||
$allowed_types = ['js','pug','scss'];
|
||||
$patterns = dirname(dirname(__file__)) . "/src/pg/patterns";
|
||||
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
<h1 class="status-complete"><span>Header
|
||||
<tool-tip role="tooltip" inert="inert" tip-position="right">Complete</tool-tip></span></h1>
|
||||
</article>
|
||||
<article id="layouts-breakpoints" data-name="breakpoints" data-status="complete" data-template="pug" data-core="true" data-path="layouts/breakpoints" style="height: 100vh">
|
||||
<h1 class="status-complete"><span>Breakpoints
|
||||
<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>Breakpoint
|
||||
<tool-tip role="tooltip" inert="inert" tip-position="right">Complete</tool-tip></span></h1>
|
||||
</article>
|
||||
<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>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -14,22 +21,27 @@
|
||||
<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">
|
||||
<div tab="scss">
|
||||
<pre class="language-sass">@import "[path-to]/breakpoints";
|
||||
@include break([breakpoint]) {
|
||||
<h2>Example</h2>
|
||||
<pre class="language-sass">@use "scss/core/breakpoint/breakpoint";
|
||||
@include breapoint.break([breakpoint]) {
|
||||
// css here
|
||||
}</pre>
|
||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@use 'sass:map';
|
||||
@use 'sass:string';
|
||||
|
||||
// default breakpoints match bootstrap 5 breakpoints.
|
||||
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px ) !default;
|
||||
|
||||
@mixin breakpoint-debug {
|
||||
@mixin debug {
|
||||
body::before, body::after {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
content: "bigger than extra large";
|
||||
display: grid;
|
||||
font-family: sans-serif;
|
||||
font-size: 25px;
|
||||
grid-template-columns: auto;
|
||||
padding: 25px;
|
||||
@@ -57,30 +69,30 @@ $grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 14
|
||||
$min: 0;
|
||||
$max: 0;
|
||||
|
||||
@if str-length($bp) == 2 {
|
||||
@if string.length($bp) == 2 {
|
||||
|
||||
// only a single break point was received
|
||||
$min: map-get($points, $bp);
|
||||
$max: map-get($points, nth(map-keys($points), index(map-keys($points), $bp) + 1));
|
||||
$min: map.get($points, $bp);
|
||||
$max: map.get($points, nth(map.keys($points), index(map.keys($points), $bp) + 1));
|
||||
|
||||
} @else {
|
||||
|
||||
|
||||
@if str-slice($bp, 0, 1) == "-" {
|
||||
@if string.slice($bp, 0, 1) == "-" {
|
||||
// no lower breakpoint was received
|
||||
$min: null;
|
||||
$max: map-get($points, str-slice($bp, 2, 3));
|
||||
$max: map.get($points, string.slice($bp, 2, 3));
|
||||
|
||||
} @else {
|
||||
|
||||
$min: map-get($points, unquote(str-slice($bp, 0, 2)));
|
||||
$min: map.get($points, string.unquote(string.slice($bp, 0, 2)));
|
||||
|
||||
|
||||
@if str-length($bp) == 3 {
|
||||
@if string.length($bp) == 3 {
|
||||
// no upper break point was received
|
||||
$max: null;
|
||||
} @else {
|
||||
$max: map-get($points, str-slice($bp, 4, 5));
|
||||
$max: map.get($points, string.slice($bp, 4, 5));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -284,26 +291,26 @@
|
||||
</sample-block>
|
||||
</color-sample>
|
||||
</color-samples>
|
||||
<div class="tab-group" id="colors">
|
||||
<tabset id="colors">
|
||||
<div data-tab="css">
|
||||
<pre class="language-css">:root {
|
||||
--colour-blue: #2e51a1,
|
||||
--colour-blue-l: #5c7abf,
|
||||
--colour-blue-xl: #b2c3ec,
|
||||
--colour-blue-d: #133176,
|
||||
--colour-blue-xd: #031235,
|
||||
--colour-blue: #2e51a1;
|
||||
--colour-blue-l: #5c7abf;
|
||||
--colour-blue-xl: #b2c3ec;
|
||||
--colour-blue-d: #133176;
|
||||
--colour-blue-xd: #031235;
|
||||
|
||||
--colour-grey: #7f7f7f,
|
||||
--colour-grey-l: #b2b2b2,
|
||||
--colour-grey-xl: #d8d8d8,
|
||||
--colour-grey-xxl: #f0f0f0,
|
||||
--colour-white: #fff,
|
||||
--colour-page: #fff,
|
||||
--colour-light: #fff,
|
||||
--colour-grey-d: #4c4c4c,
|
||||
--colour-grey-xd: #4c4c4c,
|
||||
--colour-black: #000,
|
||||
--colour-dark: #000,
|
||||
--colour-grey: #7f7f7f;
|
||||
--colour-grey-l: #b2b2b2;
|
||||
--colour-grey-xl: #d8d8d8;
|
||||
--colour-grey-xxl: #f0f0f0;
|
||||
--colour-white: #fff;
|
||||
--colour-page: #fff;
|
||||
--colour-light: #fff;
|
||||
--colour-grey-d: #4c4c4c;
|
||||
--colour-grey-xd: #4c4c4c;
|
||||
--colour-black: #000;
|
||||
--colour-dark: #000;
|
||||
}</pre>
|
||||
</div>
|
||||
<div data-tab="scss">
|
||||
@@ -332,6 +339,6 @@
|
||||
}
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</tabset>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,6 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -42,9 +49,61 @@ header
|
||||
a(href="./")= site
|
||||
// Other sections can go here, such as search and directory
|
||||
</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">
|
||||
<pre class="language-sass">@import "scss/core/header/header;
|
||||
<pre class="language-sass">@use "scss/core/header/header;
|
||||
</pre>
|
||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@@ -2,9 +2,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<div class="tab-group" id="status-report">
|
||||
<tabset id="status-report">
|
||||
<div class="status-report status-report-structure" data-tab="by&nbsp;structure">
|
||||
<table class="custom" role="presentation">
|
||||
<tbody>
|
||||
@@ -13,32 +20,38 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=this pattern doesn't exist"> This pattern doesn't exist</a></td>
|
||||
<td><span class="status-deprecated">Deprecated</span></td>
|
||||
<td><span class="status-deprecated">Deprecated</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Colours (1)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=colours"> Colours</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Components (4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=components"> Components</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete</span>
|
||||
</td>
|
||||
<tr>
|
||||
<td><a href="./?p=components/sticky-note"> Sticky note</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=components/switch"> Switch</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=components/tooltip"> Tooltip</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -46,18 +59,22 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=layouts"> Layouts</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
<tr>
|
||||
<td><a href="./?p=layouts/header"> Header</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=layouts/breakpoints"> Breakpoints</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><a href="./?p=layouts/breakpoint"> Breakpoint</a></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=layouts/tabs"> Tabs</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -65,7 +82,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./?p=status"> Status</a></td>
|
||||
<td><span class="status-complete">Complete</span></td>
|
||||
<td><span class="status-complete">Complete (Core)</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -83,43 +101,63 @@
|
||||
<td colspan="2"><span class="status-complete">Complete (10)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts/breakpoints">Breakpoints</a></td>
|
||||
<td> <a href="./?p=layouts/breakpoint">Breakpoint</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td>Layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=colours">Colours</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components">Components</a></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts/header">Header</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td>Layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts">Layouts</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=status">Status</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components/sticky-note">Sticky note</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td>Components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components/switch">Switch</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td>Components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts/tabs">Tabs</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td>Layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components/tooltip">Tooltip</a></td>
|
||||
<td><span>(core)</span>
|
||||
</td>
|
||||
<td>Components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -127,6 +165,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=this pattern doesn't exist">This pattern doesn't exist</a></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -136,63 +176,63 @@
|
||||
<table role="presentation">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts/breakpoints">Breakpoints</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td> <a href="./?p=layouts/breakpoint">Breakpoint</a></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td>Layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=colours">Colours</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components">Components</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete</span></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts/header">Header</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td>Layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts">Layouts</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=status">Status</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components/sticky-note">Sticky note</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td>Components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components/switch">Switch</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td>Components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=layouts/tabs">Tabs</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td>Layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=this pattern doesn't exist">This pattern doesn't exist</a></td>
|
||||
<td><span><span class="status-deprecated">Deprecated</span></span></td>
|
||||
<td><span> <span class="status-deprecated">Deprecated</span></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="./?p=components/tooltip">Tooltip</a></td>
|
||||
<td><span><span class="status-complete">Complete</span></span></td>
|
||||
<td><span> <span class="status-complete">Complete (Core)</span></span></td>
|
||||
<td>Components</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</tabset>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,6 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -19,19 +26,144 @@
|
||||
<sticky-note class="blue" float="right">This <strong>is</strong> a sample sticky. You can drag it out of the way if you need to see the content under it.</sticky-note></pre>
|
||||
<pre class="language-pug" tab="pug">sticky-note(float="right").blue This #[strong is] a sample sticky.
|
||||
| You can drag it out of the way if you need to see the content under it.</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>
|
||||
<pre class="language-css" data-tab="css"> 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:nth-child(1) {
|
||||
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(rgb(255, 255, 221.2)), color-stop(2%, #ffffd3), color-stop(12%, #ffffd3), color-stop(75%, rgb(255, 255, 200.8)), to(rgb(255, 255, 185.5)));
|
||||
background: linear-gradient(180deg, rgb(255, 255, 221.2) 0%, #ffffd3 2%, #ffffd3 12%, rgb(255, 255, 200.8) 75%, rgb(255, 255, 185.5) 100%);
|
||||
}
|
||||
sticky-note-wrapper sticky-note.blue > div:nth-child(2) {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(156.5265625, 220.9484375, 235.6734375)), color-stop(2%, #94daea), color-stop(12%, #94daea), color-stop(75%, rgb(139.4734375, 215.0515625, 232.3265625)), to(rgb(126.68359375, 210.62890625, 229.81640625)));
|
||||
background: linear-gradient(180deg, rgb(156.5265625, 220.9484375, 235.6734375) 0%, #94daea 2%, #94daea 12%, rgb(139.4734375, 215.0515625, 232.3265625) 75%, rgb(126.68359375, 210.62890625, 229.81640625) 100%);
|
||||
}
|
||||
sticky-note-wrapper sticky-note.pink > div:nth-child(2) {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(250.3493150685, 123.8506849315, 147.104109589)), color-stop(2%, #fa728b), color-stop(12%, #fa728b), color-stop(75%, rgb(249.6506849315, 104.1493150685, 130.895890411)), to(rgb(249.1267123288, 89.3732876712, 118.7397260274)));
|
||||
background: linear-gradient(180deg, rgb(250.3493150685, 123.8506849315, 147.104109589) 0%, #fa728b 2%, #fa728b 12%, rgb(249.6506849315, 104.1493150685, 130.895890411) 75%, rgb(249.1267123288, 89.3732876712, 118.7397260274) 100%);
|
||||
}
|
||||
sticky-note-wrapper sticky-note.green > div:nth-child(2) {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(196.6333333333, 251.5666666667, 200.925)), color-stop(2%, #bbfbc0), color-stop(12%, #bbfbc0), color-stop(75%, rgb(177.3666666667, 250.4333333333, 183.075)), to(rgb(162.9166666667, 249.5833333333, 169.6875)));
|
||||
background: linear-gradient(180deg, rgb(196.6333333333, 251.5666666667, 200.925) 0%, #bbfbc0 2%, #bbfbc0 12%, rgb(177.3666666667, 250.4333333333, 183.075) 75%, rgb(162.9166666667, 249.5833333333, 169.6875) 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">
|
||||
<h2>Example</h2>
|
||||
<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;
|
||||
</pre>
|
||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@use 'sass:color';
|
||||
@use "sass:map";
|
||||
@use 'sass:list';
|
||||
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');
|
||||
// @import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');
|
||||
|
||||
$sticky-colors: (
|
||||
"yellow": #ffffd3,
|
||||
@@ -139,34 +271,52 @@ $sticky-colors: (
|
||||
|
||||
// default colour
|
||||
> div:nth-child(2) {
|
||||
$sticky-color: nth(map.values($sticky-colors), 1);
|
||||
$sticky-color: list.nth(map.values($sticky-colors), 1);
|
||||
// background: linear-gradient(
|
||||
// 180deg,
|
||||
// lighten($sticky-color, 2%) 0%,
|
||||
// $sticky-color 2%,
|
||||
// $sticky-color 12%,
|
||||
// darken($sticky-color, 2%) 75%,
|
||||
// darken($sticky-color, 5%) 100%
|
||||
// );
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
lighten($sticky-color, 2%) 0%,
|
||||
color.adjust($sticky-color, $lightness: 2%) 0%,
|
||||
$sticky-color 2%,
|
||||
$sticky-color 12%,
|
||||
darken($sticky-color, 2%) 75%,
|
||||
darken($sticky-color, 5%) 100%
|
||||
color.adjust($sticky-color, $lightness: -2%) 75%,
|
||||
color.adjust($sticky-color, $lightness: -5%) 100%
|
||||
);
|
||||
}
|
||||
// all class colors
|
||||
@each $class, $sticky-color in $sticky-colors {
|
||||
&.#{$class} > div:nth-child(2) {
|
||||
@if $class != nth(map.keys($sticky-colors), 1) {
|
||||
@if $class != list.nth(map.keys($sticky-colors), 1) {
|
||||
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
lighten($sticky-color, 2%) 0%,
|
||||
color.adjust($sticky-color, $lightness: 2%) 0%,
|
||||
$sticky-color 2%,
|
||||
$sticky-color 12%,
|
||||
darken($sticky-color, 2%) 75%,
|
||||
darken($sticky-color, 5%) 100%
|
||||
);
|
||||
color.adjust($sticky-color, $lightness: -2%) 75%,
|
||||
color.adjust($sticky-color, $lightness: -5%) 100%
|
||||
);
|
||||
|
||||
// background: linear-gradient(
|
||||
// 180deg,
|
||||
// lighten($sticky-color, 2%) 0%,
|
||||
// $sticky-color 2%,
|
||||
// $sticky-color 12%,
|
||||
// darken($sticky-color, 2%) 75%,
|
||||
// darken($sticky-color, 5%) 100%
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&:has(sticky-note:hover) {
|
||||
background-color: #{nth(map.values($sticky-colors), 1)};
|
||||
background-color: #{list.nth(map.values($sticky-colors), 1)};
|
||||
border: 1px solid black;
|
||||
|
||||
}
|
||||
@@ -179,6 +329,7 @@ $sticky-colors: (
|
||||
}</pre>
|
||||
</div>
|
||||
<div tab="js">
|
||||
<h2>Example</h2>
|
||||
<pre class="language-js">import * as stickynote from ""./js/core/sticky-note/_sticky-note.js";
|
||||
stickynote.init()
|
||||
</pre>
|
||||
@@ -279,38 +430,40 @@ const calculateStickyPosition = (s) => {
|
||||
}
|
||||
}
|
||||
|
||||
export function init(p = document){
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||
|
||||
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 = () => {
|
||||
module.exports = {
|
||||
init: (p = document) => {
|
||||
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);
|
||||
});
|
||||
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>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -15,12 +22,38 @@
|
||||
<p class="switch">
|
||||
<label for="example-switch">Switch label (states the on state)</label><span id="example-switch" role="switch"></span>
|
||||
</p>
|
||||
<div class="tab-group" id="switches">
|
||||
<tabset id="switches">
|
||||
<pre class="language-html" tab="html"><span id="example-id" role="switch"></span></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">
|
||||
<pre class="language-sass">@import "scss/core/switch/_switch";
|
||||
<h2>Example</h2>
|
||||
<pre class="language-sass">@use "scss/core/switch/_switch";
|
||||
@include switch;
|
||||
</pre>
|
||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
@@ -61,6 +94,7 @@ $switch-height: 1.5rem !default;
|
||||
}</pre>
|
||||
</div>
|
||||
<div tab="js">
|
||||
<h2>Example</h2>
|
||||
<pre class="language-js">// Note that switch is a reserved word.
|
||||
import * as swtch from "./js/core/switch/_switch.js";
|
||||
swtch.init();
|
||||
@@ -82,17 +116,21 @@ function flip(e) {
|
||||
|
||||
module.exports = {
|
||||
init: (p = document) => {
|
||||
p.querySelectorAll("[role='switch']").forEach((sw) => {
|
||||
sw.innerHTML = "<span></span>";
|
||||
sw.setAttribute("aria-checked", "false");
|
||||
sw.setAttribute("tabindex", "0");
|
||||
sw.addEventListener("click", flip, false);
|
||||
sw.addEventListener("keypress", flip, false);
|
||||
})
|
||||
try {
|
||||
p.querySelectorAll("[role='switch']").forEach((sw) => {
|
||||
sw.innerHTML = "<span></span>";
|
||||
sw.setAttribute("aria-checked", "false");
|
||||
sw.setAttribute("tabindex", "0");
|
||||
sw.addEventListener("click", flip, false);
|
||||
sw.addEventListener("keypress", flip, false);
|
||||
})
|
||||
} catch (e) {
|
||||
console.warn("Cannot initialise switches.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</tabset>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,6 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -16,59 +23,64 @@
|
||||
</ul>
|
||||
<p>Users should not need to see content of multiple tabs simultaneously and the user should be able to easily recognise where they are within the content. </p>
|
||||
<h2>How to use it</h2>
|
||||
<p>The structure of the tab set is defined in html. There are two forms supported. Adding a class of <code class="inline">.tab-group</code> to the container element will work in place of the <code class="inline">tabset</code> tag, and the tab panels can be defined using either <code class="inline">tab=""</code> or <code class="inline">data-tab=""</code>. Passing an optional element to the init function will initialise tabs within that element. </p>
|
||||
<p>The structure of the tab set is defined in html. There are two forms supported. Adding a class of <code class="inline">.tab-group</code> to the container element will work in place of the <code class="inline">tabset</code> tag, and the tab panels can be defined using either <code class="inline">tab=""</code> or <code class="inline">data-tab=""</code>. Passing an optional element to the init function will initialise tabs within that element. Adding a <code class="inline">order=""</code> or <code class="inline">data-order=""</code> element to the tabset you can have the tabs sorted in a consistent order across tabsets.</p>
|
||||
<h2>Example</h2>
|
||||
<pre class="language-pug" tab="pug">tabset(order="tab2, tab1")
|
||||
div(tab="tab1")
|
||||
div(tab="tab2")
|
||||
</pre>
|
||||
<tabset id="tabs">
|
||||
<pre class="language-html" tab="html">
|
||||
<tabset id="uniqueID">
|
||||
<div tab="[tab title]"></div>
|
||||
<div tab="[tab title]"></div>
|
||||
<tabset id="uniqueID" order="tab title 2,tab title 1">
|
||||
<div tab="[tab title 1]"></div>
|
||||
<div tab="[tab title 2]"></div>
|
||||
</tabset></pre>
|
||||
<pre class="language-pug" tab="pug">tabset#uniqueID
|
||||
div(tab="[tab title]")
|
||||
div(tab="[tab title]")
|
||||
<pre class="language-pug" tab="pug">tabset#uniqueID(order="tab title 2,tab title 1")
|
||||
div(tab="[tab title 1]")
|
||||
div(tab="[tab title 2]")
|
||||
</pre>
|
||||
<pre class="language-css" tab="css">tabset, .tab-group {
|
||||
margin: 2rem 0 1rem 0;
|
||||
}
|
||||
tabset > ul, .tab-group > ul {
|
||||
tabset [role=tablist], .tab-group [role=tablist] {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
tabset > ul li.separator, .tab-group > ul li.separator {
|
||||
tabset [role=tablist] li.separator, .tab-group [role=tablist] 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] {
|
||||
tabset [role=tablist] li[role=tab], .tab-group [role=tablist] li[role=tab] {
|
||||
background-color: #FFF;
|
||||
border-left: 1px solid #7f7f7f;
|
||||
border-top: 1px solid #7f7f7f;
|
||||
border-right: 1px solid #7f7f7f;
|
||||
border-radius: 0.5rem 0.5rem 0 0;
|
||||
border-top: 1px solid #7f7f7f;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 1rem 1.5rem 0.14rem 1.5rem;
|
||||
z-index: 2;
|
||||
}
|
||||
tabset [role=tab]:last-of-type, .tab-group [role=tab]:last-of-type {
|
||||
tabset [role=tablist] li[role=tab]:last-of-type, .tab-group [role=tablist] li[role=tab]:last-of-type {
|
||||
border-right: 1px solid #7f7f7f;
|
||||
}
|
||||
tabset [role=tab]:not(.selected), .tab-group [role=tab]:not(.selected) {
|
||||
tabset [role=tablist] li[role=tab]:not(.selected), .tab-group [role=tablist] li[role=tab]:not(.selected) {
|
||||
background-color: #f0f0f0;
|
||||
border-bottom: 1px solid #7f7f7f;
|
||||
}
|
||||
tabset [role=tab] span, .tab-group [role=tab] span {
|
||||
tabset [role=tablist] li[role=tab] span, .tab-group [role=tablist] li[role=tab] span {
|
||||
display: block;
|
||||
margin: 0 0 0.5rem 0;
|
||||
}
|
||||
tabset .tab-hidden, .tab-group .tab-hidden {
|
||||
display: none;
|
||||
}
|
||||
tabset [role=tabpanel], .tab-group [role=tabpanel] {
|
||||
background-color: #FFF;
|
||||
border: 1px solid #7f7f7f;
|
||||
@@ -80,7 +92,8 @@ tabset [role=tabpanel]:not(.open), .tab-group [role=tabpanel]:not(.open) {
|
||||
display: none;
|
||||
}</pre>
|
||||
<div tab="scss">
|
||||
<pre class="language-sass">@import "scss/core/tabs/_tabs";
|
||||
<h2>Example</h2>
|
||||
<pre class="language-sass">@use "scss/core/tabs/_tabs";
|
||||
@include tabs{
|
||||
// optional content block
|
||||
};
|
||||
@@ -89,56 +102,66 @@ tabset [role=tabpanel]:not(.open), .tab-group [role=tabpanel]:not(.open) {
|
||||
// Licensed under CC BY-SA 4.0
|
||||
|
||||
$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-text: #000 !default;
|
||||
$tab-notselected: #f0f0f0 !default;
|
||||
$tab-notselected-text: #000 !default;
|
||||
|
||||
@mixin tabs {
|
||||
tabset, .tab-group {
|
||||
margin: 2rem 0 1rem 0;
|
||||
> ul {
|
||||
|
||||
[role="tablist"] {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
li.separator {
|
||||
border-bottom: 1px solid $tab-border;
|
||||
border-left: 1px solid $tab-border;
|
||||
display: inline-block;
|
||||
margin: .45rem 0 0 0;
|
||||
width: 100%;
|
||||
|
||||
li {
|
||||
&.separator {
|
||||
border-bottom: 1px solid $tab-border;
|
||||
display: inline-block;
|
||||
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 {
|
||||
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"] {
|
||||
background-color: $tab-selected;
|
||||
border: 1px solid $tab-border;
|
||||
@@ -149,13 +172,13 @@ $tab-notselected: #f0f0f0 !default;
|
||||
&:not(.open) {
|
||||
display: none;
|
||||
}
|
||||
@content;
|
||||
|
||||
}
|
||||
@content;
|
||||
}
|
||||
}</pre>
|
||||
</div>
|
||||
<div tab="js">
|
||||
<h2>Example</h2>
|
||||
<pre class="language-js">import * as tabs from "./js/core/tabs/_tabs.js";
|
||||
tabs.init();</pre>
|
||||
<pre class="language-js">/* DS2 core (c) 2024 Alexander McIlwraith
|
||||
@@ -169,26 +192,83 @@ const click = new MouseEvent('click', {
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
export function init(p = document, s = true) {
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
const waitForElement = (selector) => {
|
||||
return new Promise(resolve => {
|
||||
if (document.querySelector(selector)) {
|
||||
return resolve(document.querySelector(selector));
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(mutations => {
|
||||
if (document.querySelector(selector)) {
|
||||
observer.disconnect();
|
||||
resolve(document.querySelector(selector));
|
||||
}
|
||||
});
|
||||
|
||||
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
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"));
|
||||
|
||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||
document.getElementById(tabPanelId).classList.add("open");
|
||||
}
|
||||
|
||||
let pushState = 0;
|
||||
let tabsetCount = 0;
|
||||
|
||||
export function init(container = document, spacer = true, args = {}) {
|
||||
container.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||
if (tabGroup.getAttribute("id") == null) {
|
||||
tabGroup.setAttribute("id", "tab-group-" + tabsetCount);
|
||||
tabsetCount++;
|
||||
}
|
||||
|
||||
const tabgroup = tabGroup.getAttribute("id");
|
||||
let tablist = "";
|
||||
|
||||
Array.from(tabGroup.children).forEach(child => {
|
||||
const tab = child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||
|
||||
// is details?
|
||||
let dtls = child.nodeName == "DETAILS" ? true : false;
|
||||
|
||||
// get the tab text
|
||||
let tab = dtls ? child.querySelector("summary").innerHTML : child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||
|
||||
// if the tab text is not blank
|
||||
if (tab !== null) {
|
||||
const tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
||||
const tabPanel = document.createElement('div');
|
||||
|
||||
|
||||
// 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}`);
|
||||
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>`;
|
||||
tablist += `<li tabindex="0" role="tab" id="tab-${tabgroup}-${tabID}"><span>${tab}</span></li>`;
|
||||
} else {
|
||||
child.classList.add("tab-hidden");
|
||||
}
|
||||
@@ -196,23 +276,40 @@ export function init(p = document, s = true) {
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
ul.setAttribute("role", "tablist");
|
||||
ul.innerHTML = s != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||
ul.innerHTML = spacer != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
tab.addEventListener("click", () => {
|
||||
const siblings = Array.from(tab.parentNode.children);
|
||||
siblings.forEach(sibling => sibling.classList.remove("selected"));
|
||||
tab.classList.add("selected");
|
||||
if ( tabGroup.hasAttribute("order") || tabGroup.hasAttribute("data-order") ) {
|
||||
let order = (tabGroup.getAttribute("order") || tabGroup.getAttribute("data-order")).split(",");
|
||||
|
||||
const tabPanels = Array.from(tab.parentNode.parentNode.children)
|
||||
.filter(child => child.getAttribute("role") === "tabpanel");
|
||||
tabPanels.forEach(panel => panel.classList.remove("open"));
|
||||
const items = Array.from(ul.getElementsByTagName("li"));
|
||||
items.sort((a, b) => {
|
||||
console.log("here")
|
||||
const aa = order.indexOf(a.textContent.trim());
|
||||
const bb = order.indexOf(b.textContent.trim());
|
||||
|
||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||
document.getElementById(tabPanelId).classList.add("open");
|
||||
// Check if both items exist in orderArray
|
||||
if (aa === -1) return 1; // Move to the end if not found
|
||||
if (bb === -1) return -1; // Move to the end if not found
|
||||
|
||||
return aa - bb; // Sort based on the defined order
|
||||
});
|
||||
|
||||
ul.innerHTML = '';
|
||||
items.forEach(item => ul.appendChild(item));
|
||||
}
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
tab.addEventListener("click", (evt) => {
|
||||
if (pushState == 0) {
|
||||
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.parentNode.firstChild.getAttribute("id")}, "", `#${tab.parentNode.firstChild.getAttribute("id")}`);
|
||||
pushState++;
|
||||
}
|
||||
|
||||
chooseTab(evt.currentTarget);
|
||||
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.getAttribute("id")}, "", `#${tab.getAttribute("id")}`);
|
||||
pushState++;
|
||||
});
|
||||
|
||||
tab.addEventListener("keypress", (e) => {
|
||||
e.preventDefault();
|
||||
@@ -221,6 +318,24 @@ export function init(p = document, s = true) {
|
||||
}
|
||||
})
|
||||
});
|
||||
ul.querySelector("li").classList.add("selected");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<body data-prismjs-copy-timeout="1500">
|
||||
<h2>What is it</h2>
|
||||
@@ -36,6 +43,7 @@
|
||||
background: #fff;
|
||||
border-radius: 0.5rem;
|
||||
color: #000;
|
||||
display: none;
|
||||
-webkit-filter: drop-shadow(0 3px 3px hsla(0, 0%, 0%, 0.15)) drop-shadow(0 12px 12px hsla(0, 0%, 0%, 0.15));
|
||||
filter: drop-shadow(0 3px 3px hsla(0, 0%, 0%, 0.15)) drop-shadow(0 12px 12px hsla(0, 0%, 0%, 0.15));
|
||||
font-size: 1rem;
|
||||
@@ -162,6 +170,7 @@
|
||||
position: relative;
|
||||
}
|
||||
:has(> [role=tooltip]):is(:hover, :focus-visible, :active) > [role=tooltip] {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
-webkit-transition-delay: 300ms;
|
||||
transition-delay: 300ms;
|
||||
@@ -182,11 +191,13 @@
|
||||
}
|
||||
}</pre>
|
||||
<div tab="scss">
|
||||
<pre class="language-sass">@import "scss/core/tooltip/_tooltip";
|
||||
<h2>Example</h2>
|
||||
<pre class="language-sass">@use "scss/core/tooltip/_tooltip";
|
||||
@include tooltip;</pre>
|
||||
<pre class="language-sass">//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
$font-body: sans-serif !default;
|
||||
$tooltip-border-radius: .5rem !default;
|
||||
$tooltip-dark-allow: true !default;
|
||||
$tooltip-dark-background: #1f2127 !default;
|
||||
@@ -214,7 +225,9 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
||||
background: $tooltip-light-background;
|
||||
border-radius: $tooltip-border-radius;
|
||||
color: $tooltip-light-foreground;
|
||||
display: none;
|
||||
filter: $tooltip-light-drop-shadow;
|
||||
$font-family: $font-body;
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
inline-size: max-content;
|
||||
@@ -231,7 +244,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
||||
user-select: none;
|
||||
will-change: filter;
|
||||
z-index: 10;
|
||||
|
||||
|
||||
&::before {
|
||||
clip-path: inset(50%);
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
@@ -336,6 +349,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
||||
:has(> [role="tooltip"]) {
|
||||
position: relative;
|
||||
&:is(:hover, :focus-visible, :active) > [role="tooltip"] {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
transition-delay: 300ms;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ const font = {
|
||||
size: 0
|
||||
}
|
||||
|
||||
const copyColourFallback = (copyInfo, attr) => {
|
||||
const copyFallback = (copyInfo, attr) => {
|
||||
console.log("fallback")
|
||||
var textArea = document.createElement('textarea');
|
||||
textArea.value = copyInfo;
|
||||
@@ -71,22 +71,6 @@ const showMessage = (m, s) => {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
const oneClickSelect = (e, t = e.currentTarget) => {
|
||||
// In here, "this" is the element
|
||||
var range, selection;
|
||||
if (window.getSelection) {
|
||||
selection = window.getSelection();
|
||||
range = document.createRange();
|
||||
range.selectNodeContents(t);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
} else if (document.body.createTextRange) {
|
||||
range = document.body.createTextRange();
|
||||
range.moveToElementText(t);
|
||||
range.select();
|
||||
}
|
||||
}
|
||||
|
||||
const getURLVars = () => {
|
||||
var oResult = {};
|
||||
if (location.search.length > 0) {
|
||||
@@ -145,12 +129,26 @@ module.exports = {
|
||||
}
|
||||
return "";
|
||||
},
|
||||
remove: (cnane) => {
|
||||
setCookie(cname, "", -1);
|
||||
remove: (cname) => {
|
||||
module.exports.cookie.set(cname, null, new Date(null));
|
||||
},
|
||||
},
|
||||
oneClickSelect: (e, t = e.currentTarget) => {
|
||||
// In here, "this" is the element
|
||||
var range, selection;
|
||||
if (window.getSelection) {
|
||||
selection = window.getSelection();
|
||||
range = document.createRange();
|
||||
range.selectNodeContents(t);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
} else if (document.body.createTextRange) {
|
||||
range = document.body.createTextRange();
|
||||
range.moveToElementText(t);
|
||||
range.select();
|
||||
}
|
||||
},
|
||||
colour: {
|
||||
|
||||
copy: (w, t) => {
|
||||
let c = t.parentNode.getAttribute("data-" + (w=="var" ? "token" : w));
|
||||
c = w == "var" ? `var(${c})` : c;
|
||||
@@ -159,10 +157,10 @@ module.exports = {
|
||||
navigator.clipboard.writeText(c).then(function() {
|
||||
showMessage(`Copied ${w}.`);
|
||||
}, function(e) {
|
||||
copyColourFallback(c,w);
|
||||
copyFallback(c,w);
|
||||
});
|
||||
} else {
|
||||
copyColourFallback(c, w);
|
||||
copyFallback(c, w);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -178,9 +176,26 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
},
|
||||
// getCSS: (el, prop, b = false) {
|
||||
// return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
// },
|
||||
getCSS: (el, prop, b = false) => {
|
||||
return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
},
|
||||
getTabPath: (t) => {
|
||||
let url = window.location.toString();
|
||||
url = url.indexOf("?") > 0 ? url.substring(0,url.indexOf("?")) : url;
|
||||
url = `${url}?p=${t.closest("article").getAttribute("data-path")}#${t.getAttribute("id")}`
|
||||
let type = "URL";
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(url).then(function() {
|
||||
showMessage(`Copied ${type}.`);
|
||||
}, function(e) {
|
||||
copyFallback(url,type);
|
||||
});
|
||||
} else {
|
||||
copyFallback(url, type);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
init: (args = {}) => {
|
||||
const url = getURLVars();
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||
@@ -211,10 +226,6 @@ module.exports = {
|
||||
articles.forEach(article => {
|
||||
let a = article.target;
|
||||
|
||||
// console.log("observing: ", { id: a.getAttribute("id"), intersecting: a.isIntersecting } )
|
||||
// if (article.intersectionRatio > 0) {
|
||||
// console.log("Is interesecting: ", { id: article.target.getAttribute("id"), intersecting: article.isIntersecting, ratio: article.intersectionRatio } )
|
||||
|
||||
if (article.isIntersecting == true) {
|
||||
let path = a.getAttribute("data-path");
|
||||
path = "patterns/" +
|
||||
@@ -255,7 +266,7 @@ module.exports = {
|
||||
|
||||
a.querySelectorAll("code").forEach((c)=> {
|
||||
c.onclick = (e) => {
|
||||
oneClickSelect(e);
|
||||
module.exports.oneClickSelect(e);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -12,10 +12,12 @@ import * as stickynote from "../pg/patterns/core/sticky-note/_sticky-note.js";
|
||||
import * as swtch from "../pg/patterns/core/switch/_switch.js";
|
||||
import * as tabs from "../pg/patterns/core/tabs/_tabs.js";
|
||||
|
||||
// init core
|
||||
// init c
|
||||
core.init({
|
||||
success: (a) => {
|
||||
tabs.init(a);
|
||||
tabs.init(a, true, {
|
||||
shiftModifier: core.getTabPath,
|
||||
});
|
||||
swtch.init(a);
|
||||
stickynote.init(a);
|
||||
},
|
||||
@@ -24,6 +26,7 @@ core.init({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// deprecated switch handler
|
||||
const flipInfoSwitch = (e, s = e.currentTarget) => {
|
||||
|
||||
@@ -37,12 +40,10 @@ const flipInfoSwitch = (e, s = e.currentTarget) => {
|
||||
break;
|
||||
|
||||
case "breakpoints" :
|
||||
console.log("here")
|
||||
core.cookie.set("show-breakpoints", s.getAttribute("aria-checked"), 30, "/");
|
||||
document.querySelector("html").classList[( s.getAttribute("aria-checked") == "true" ? "add" : "remove" )]("show-breakpoints");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// create a pure JS mouse click event
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
- var site = "DS2 core"
|
||||
- var lang = "en-uk"
|
||||
- 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", "Example"]
|
||||
- var downloadExtensions = ["js", "pug", "scss"]
|
||||
- var generateColourToken = ["colours"]
|
||||
|
||||
-
|
||||
@@ -49,7 +50,7 @@
|
||||
core: true,
|
||||
},
|
||||
{
|
||||
name: "breakpoints",
|
||||
name: "breakpoint",
|
||||
status: "complete",
|
||||
core: true,
|
||||
},
|
||||
|
||||
@@ -128,15 +128,15 @@
|
||||
- function generateCSS(c, p) {
|
||||
- let o = "";
|
||||
- for (let i = 0; i < c.length; i++) {
|
||||
- o += `\n\t--${p}-${c[i].name.toLowerCase()}: ${ color(c[i].color, "hex").toLowerCase() },\n`;
|
||||
- o += `\n\t--${p}-${c[i].name.toLowerCase()}: ${ color(c[i].color, "hex").toLowerCase() };\n`;
|
||||
- for (let ii = 0; ii < c[i].grad.l.length; ii++) {
|
||||
- o += `\t--${p}-${c[i].grad.l[ii].n.toLowerCase()}: ${ color(c[i].grad.l[ii].c, "hex").toLowerCase() },\n`;
|
||||
- o += `\t--${p}-${c[i].grad.l[ii].n.toLowerCase()}: ${ color(c[i].grad.l[ii].c, "hex").toLowerCase() };\n`;
|
||||
- }
|
||||
- for (let ii = 0; ii < c[i].grad.d.length; ii++) {
|
||||
- o += `\t--${p}-${c[i].grad.d[ii].n.toLowerCase()}: ${ color(c[i].grad.d[ii].c, "hex").toLowerCase() },\n`;
|
||||
- o += `\t--${p}-${c[i].grad.d[ii].n.toLowerCase()}: ${ color(c[i].grad.d[ii].c, "hex").toLowerCase() };\n`;
|
||||
- }
|
||||
- }
|
||||
- return o;
|
||||
- return o;
|
||||
- }
|
||||
|
||||
if !colortxt
|
||||
@@ -240,7 +240,7 @@ mixin colour-samples(colors, theid)
|
||||
notes= colors[i].note
|
||||
- }
|
||||
|
||||
div.tab-group(id= theid )
|
||||
tabset(id= theid order= taborder)
|
||||
- csstab = csstab == undefined ? "css" : csstab
|
||||
- scsstab = scsstab == undefined ? "scss" : scsstab
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@use "../pg/patterns/core/breakpoint/breakpoint";
|
||||
|
||||
@mixin core-colour-samples {
|
||||
|
||||
#copystatus {
|
||||
@@ -36,14 +38,14 @@
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
@include break(-lg) {
|
||||
@include breakpoint.break(-lg) {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@include break(-sm) {
|
||||
@include breakpoint.break(-sm) {
|
||||
grid-template-columns: auto;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
@@ -67,7 +69,7 @@
|
||||
width: 20rem;
|
||||
max-width: 318px;
|
||||
|
||||
@include break(-lg) {
|
||||
@include breakpoint.break(-lg) {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -102,7 +104,7 @@
|
||||
display: grid;
|
||||
gap: .5rem;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: 2.5rem repeat(2, max-content);
|
||||
grid-template-rows: repeat(3, max-content);
|
||||
.result {
|
||||
align-items: center;
|
||||
border-radius: .5rem;
|
||||
|
||||
@@ -73,6 +73,9 @@ html(lang= lang )
|
||||
|
||||
|
||||
a.skip(href="#main") Skip to main content
|
||||
|
||||
block top
|
||||
|
||||
div.container
|
||||
|
||||
block header
|
||||
@@ -83,4 +86,8 @@ html(lang= lang )
|
||||
each category in content
|
||||
+show-content(category, "")
|
||||
|
||||
block footer
|
||||
|
||||
block bottom
|
||||
|
||||
script(src="assets/scaffolding-min.js")
|
||||
|
||||
@@ -37,6 +37,11 @@ html
|
||||
head
|
||||
|
||||
title Pattern
|
||||
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;
|
||||
|
||||
body(data-assetpath= assetpath data-prismjs-copy-timeout="1500")
|
||||
|
||||
|
||||
@@ -5,270 +5,18 @@
|
||||
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
|
||||
overwritten. \n*/\n\n\n`
|
||||
| !{out}
|
||||
|
||||
|
||||
include ../_config
|
||||
include _colour-samples
|
||||
include _core-colour-samples.scss
|
||||
|
||||
|
||||
-
|
||||
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) 10rem repeat(3, 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: 2.5rem repeat(2, 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: 10.5rem;
|
||||
|
||||
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;
|
||||
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}: (`
|
||||
- out = `\n\n//colour tokens\n$${colorpfx}: (`
|
||||
|
||||
each val in generateColourToken
|
||||
- out += generateSCSS(eval(val), colorpfx)
|
||||
|
||||
|
||||
|
||||
|
||||
//- var scss = $colors
|
||||
| !{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
|
||||
function recursor($dir, $type) {
|
||||
@@ -25,7 +35,7 @@
|
||||
return $result;
|
||||
}
|
||||
|
||||
$allowed_types = ["scss", "js"];
|
||||
$allowed_types = {{extensions}};
|
||||
$patterns = dirname(dirname(__file__)) . "/src/pg/patterns";
|
||||
|
||||
|
||||
@@ -50,5 +60,7 @@
|
||||
|
||||
header('Content-type: application/zip');
|
||||
header(sprintf('Content-Disposition: attachment; filename="%s.zip"', $type));
|
||||
echo(file_get_contents($t)); ?>`
|
||||
echo(file_get_contents($t)); ?>`.replace("{{extensions}}", extensions)
|
||||
| !{php}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@use 'sass:map';
|
||||
@use 'sass:string';
|
||||
|
||||
// default breakpoints match bootstrap 5 breakpoints.
|
||||
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px ) !default;
|
||||
|
||||
@mixin breakpoint-debug {
|
||||
@mixin debug {
|
||||
body::before, body::after {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
@@ -38,30 +41,30 @@ $grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 14
|
||||
$min: 0;
|
||||
$max: 0;
|
||||
|
||||
@if str-length($bp) == 2 {
|
||||
@if string.length($bp) == 2 {
|
||||
|
||||
// only a single break point was received
|
||||
$min: map-get($points, $bp);
|
||||
$max: map-get($points, nth(map-keys($points), index(map-keys($points), $bp) + 1));
|
||||
$min: map.get($points, $bp);
|
||||
$max: map.get($points, nth(map.keys($points), index(map.keys($points), $bp) + 1));
|
||||
|
||||
} @else {
|
||||
|
||||
|
||||
@if str-slice($bp, 0, 1) == "-" {
|
||||
@if string.slice($bp, 0, 1) == "-" {
|
||||
// no lower breakpoint was received
|
||||
$min: null;
|
||||
$max: map-get($points, str-slice($bp, 2, 3));
|
||||
$max: map.get($points, string.slice($bp, 2, 3));
|
||||
|
||||
} @else {
|
||||
|
||||
$min: map-get($points, unquote(str-slice($bp, 0, 2)));
|
||||
$min: map.get($points, string.unquote(string.slice($bp, 0, 2)));
|
||||
|
||||
|
||||
@if str-length($bp) == 3 {
|
||||
@if string.length($bp) == 3 {
|
||||
// no upper break point was received
|
||||
$max: null;
|
||||
} @else {
|
||||
$max: map-get($points, str-slice($bp, 4, 5));
|
||||
$max: map.get($points, string.slice($bp, 4, 5));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,14 @@ block content
|
||||
|
||||
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.
|
||||
|
||||
tabset#breakpoints
|
||||
tabset#breakpoints(order= taborder)
|
||||
div(tab="scss")
|
||||
+h(3)
|
||||
pre.language-sass.
|
||||
@import "scss/core/breakpoints/breakpoints";
|
||||
@include break([breakpoint]) {
|
||||
@use "scss/core/breakpoint/breakpoint";
|
||||
@include breapoint.break([breakpoint]) {
|
||||
// css here
|
||||
}
|
||||
+h(4)
|
||||
pre.language-sass
|
||||
include _breakpoints.scss
|
||||
include _breakpoint.scss
|
||||
@@ -1 +1,53 @@
|
||||
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}
|
||||
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;
|
||||
}
|
||||
@@ -5,5 +5,5 @@
|
||||
|
||||
// this file should not be minified
|
||||
|
||||
@import "_header.scss";
|
||||
@include header;
|
||||
@use "_header.scss";
|
||||
@include header.header;
|
||||
@@ -12,7 +12,7 @@ block content
|
||||
+h(2)
|
||||
p Place the header at the top of the page after the skip to main content link. You will likely want to replace core header should be replaced with your own site's header. To do this, remove the #[code.inline.language-js core: true ] and create your own pattern in the location you wish it in your design system.
|
||||
|
||||
tabset#header
|
||||
tabset#header(order= taborder)
|
||||
pre.language-html(tab="html")
|
||||
// create temp variables and store the design system values
|
||||
- var tmpsite= site
|
||||
@@ -32,7 +32,7 @@ block content
|
||||
div.language-sass(tab="scss")
|
||||
|
||||
pre.language-sass.
|
||||
@import "scss/core/header/header;
|
||||
@use "scss/core/header/header;
|
||||
|
||||
pre.language-sass
|
||||
include _header.scss
|
||||
@@ -6,13 +6,13 @@ block content
|
||||
-
|
||||
- let list = []
|
||||
- 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) {
|
||||
- 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) {
|
||||
- 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 0;
|
||||
- });
|
||||
- });
|
||||
- function createURL(p) {
|
||||
- p = p.split(".")
|
||||
// - return p.length
|
||||
@@ -49,7 +49,7 @@ block content
|
||||
- return count;
|
||||
- }
|
||||
|
||||
div.tab-group#status-report
|
||||
tabset#status-report(order= taborder)
|
||||
div.status-report.status-report-structure(data-tab="by structure")
|
||||
table.custom(role="presentation")
|
||||
tbody
|
||||
@@ -64,7 +64,10 @@ block content
|
||||
else
|
||||
| !{category.name.toContent().toSentenceCase()}
|
||||
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
|
||||
@@ -77,7 +80,10 @@ block content
|
||||
else
|
||||
| !{pattern.name.toContent().toSentenceCase()}
|
||||
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
|
||||
|
||||
@@ -90,14 +96,22 @@ block content
|
||||
else
|
||||
| !{sub.name.toContent().toSentenceCase()}
|
||||
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")
|
||||
table(role="presentation")
|
||||
|
||||
tbody
|
||||
- bystatus = list;
|
||||
- for(i=0; i < bystatus.length; i++) {
|
||||
- if (bystatus[i].core == "true") {
|
||||
- bystatus[i].status = "complete"
|
||||
- }
|
||||
- }
|
||||
each status in statuses || []
|
||||
- out = list.filter(list => list.status === status.name)
|
||||
- out = bystatus.filter(list => list.status === status.name)
|
||||
tr
|
||||
td(colspan="2")
|
||||
span(class="status-" + status.name)= status.name.toContent().toSentenceCase() + " (" + out.length + ")"
|
||||
@@ -110,6 +124,9 @@ block content
|
||||
| !{item.display}
|
||||
else
|
||||
| !{item.name.toContent().toSentenceCase()}
|
||||
td
|
||||
if item.core == "true"
|
||||
span (core)
|
||||
td= getCategory(item.path)
|
||||
|
||||
div.status-report.status-report-alpha(data-tab="alphabetical")
|
||||
@@ -124,7 +141,10 @@ block content
|
||||
else
|
||||
| !{item.name.toContent().toSentenceCase()}
|
||||
td
|
||||
span
|
||||
span(class="status-" + item.status)= item.status.toContent().toTitleCase()
|
||||
span
|
||||
if item.core == "true"
|
||||
span.status-complete Complete (Core)
|
||||
else
|
||||
span(class="status-" + item.status)= item.status.toContent().toTitleCase()
|
||||
td= getCategory(item.path)
|
||||
|
||||
|
||||
@@ -95,37 +95,39 @@ const calculateStickyPosition = (s) => {
|
||||
}
|
||||
}
|
||||
|
||||
export function init(p = document){
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||
|
||||
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 = () => {
|
||||
module.exports = {
|
||||
init: (p = document) => {
|
||||
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);
|
||||
});
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@use 'sass:color';
|
||||
@use "sass:map";
|
||||
@use 'sass:list';
|
||||
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');
|
||||
// @import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');
|
||||
|
||||
$sticky-colors: (
|
||||
"yellow": #ffffd3,
|
||||
@@ -112,34 +112,52 @@ $sticky-colors: (
|
||||
|
||||
// default colour
|
||||
> div:nth-child(2) {
|
||||
$sticky-color: nth(map.values($sticky-colors), 1);
|
||||
$sticky-color: list.nth(map.values($sticky-colors), 1);
|
||||
// background: linear-gradient(
|
||||
// 180deg,
|
||||
// lighten($sticky-color, 2%) 0%,
|
||||
// $sticky-color 2%,
|
||||
// $sticky-color 12%,
|
||||
// darken($sticky-color, 2%) 75%,
|
||||
// darken($sticky-color, 5%) 100%
|
||||
// );
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
lighten($sticky-color, 2%) 0%,
|
||||
color.adjust($sticky-color, $lightness: 2%) 0%,
|
||||
$sticky-color 2%,
|
||||
$sticky-color 12%,
|
||||
darken($sticky-color, 2%) 75%,
|
||||
darken($sticky-color, 5%) 100%
|
||||
color.adjust($sticky-color, $lightness: -2%) 75%,
|
||||
color.adjust($sticky-color, $lightness: -5%) 100%
|
||||
);
|
||||
}
|
||||
// all class colors
|
||||
@each $class, $sticky-color in $sticky-colors {
|
||||
&.#{$class} > div:nth-child(2) {
|
||||
@if $class != nth(map.keys($sticky-colors), 1) {
|
||||
@if $class != list.nth(map.keys($sticky-colors), 1) {
|
||||
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
lighten($sticky-color, 2%) 0%,
|
||||
color.adjust($sticky-color, $lightness: 2%) 0%,
|
||||
$sticky-color 2%,
|
||||
$sticky-color 12%,
|
||||
darken($sticky-color, 2%) 75%,
|
||||
darken($sticky-color, 5%) 100%
|
||||
);
|
||||
color.adjust($sticky-color, $lightness: -2%) 75%,
|
||||
color.adjust($sticky-color, $lightness: -5%) 100%
|
||||
);
|
||||
|
||||
// background: linear-gradient(
|
||||
// 180deg,
|
||||
// lighten($sticky-color, 2%) 0%,
|
||||
// $sticky-color 2%,
|
||||
// $sticky-color 12%,
|
||||
// darken($sticky-color, 2%) 75%,
|
||||
// darken($sticky-color, 5%) 100%
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&:has(sticky-note:hover) {
|
||||
background-color: #{nth(map.values($sticky-colors), 1)};
|
||||
background-color: #{list.nth(map.values($sticky-colors), 1)};
|
||||
border: 1px solid black;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ block content
|
||||
p If you wish to create a custom element, that extends another HTML element, the native element has to be extended in customElements.define(). Custom elements that inherit native elements are also known as "type extension custom elements".
|
||||
|
||||
|
||||
tabset#sticky-note
|
||||
tabset#sticky-note(order= taborder)
|
||||
pre.language-html(tab="html")
|
||||
include _sticky-note.pug
|
||||
pre.language-pug(tab="pug")
|
||||
@@ -26,7 +26,7 @@ block content
|
||||
+h(3)
|
||||
pre.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;
|
||||
|
||||
+h(4)
|
||||
|
||||
@@ -1 +1,125 @@
|
||||
@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}
|
||||
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:nth-child(1) {
|
||||
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(rgb(255, 255, 221.2)), color-stop(2%, #ffffd3), color-stop(12%, #ffffd3), color-stop(75%, rgb(255, 255, 200.8)), to(rgb(255, 255, 185.5)));
|
||||
background: linear-gradient(180deg, rgb(255, 255, 221.2) 0%, #ffffd3 2%, #ffffd3 12%, rgb(255, 255, 200.8) 75%, rgb(255, 255, 185.5) 100%);
|
||||
}
|
||||
sticky-note-wrapper sticky-note.blue > div:nth-child(2) {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(156.5265625, 220.9484375, 235.6734375)), color-stop(2%, #94daea), color-stop(12%, #94daea), color-stop(75%, rgb(139.4734375, 215.0515625, 232.3265625)), to(rgb(126.68359375, 210.62890625, 229.81640625)));
|
||||
background: linear-gradient(180deg, rgb(156.5265625, 220.9484375, 235.6734375) 0%, #94daea 2%, #94daea 12%, rgb(139.4734375, 215.0515625, 232.3265625) 75%, rgb(126.68359375, 210.62890625, 229.81640625) 100%);
|
||||
}
|
||||
sticky-note-wrapper sticky-note.pink > div:nth-child(2) {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(250.3493150685, 123.8506849315, 147.104109589)), color-stop(2%, #fa728b), color-stop(12%, #fa728b), color-stop(75%, rgb(249.6506849315, 104.1493150685, 130.895890411)), to(rgb(249.1267123288, 89.3732876712, 118.7397260274)));
|
||||
background: linear-gradient(180deg, rgb(250.3493150685, 123.8506849315, 147.104109589) 0%, #fa728b 2%, #fa728b 12%, rgb(249.6506849315, 104.1493150685, 130.895890411) 75%, rgb(249.1267123288, 89.3732876712, 118.7397260274) 100%);
|
||||
}
|
||||
sticky-note-wrapper sticky-note.green > div:nth-child(2) {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(196.6333333333, 251.5666666667, 200.925)), color-stop(2%, #bbfbc0), color-stop(12%, #bbfbc0), color-stop(75%, rgb(177.3666666667, 250.4333333333, 183.075)), to(rgb(162.9166666667, 249.5833333333, 169.6875)));
|
||||
background: linear-gradient(180deg, rgb(196.6333333333, 251.5666666667, 200.925) 0%, #bbfbc0 2%, #bbfbc0 12%, rgb(177.3666666667, 250.4333333333, 183.075) 75%, rgb(162.9166666667, 249.5833333333, 169.6875) 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;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@import "_sticky-note";
|
||||
@include sticky-note;
|
||||
@use "_sticky-note";
|
||||
@include sticky-note.sticky-note;
|
||||
@@ -15,12 +15,16 @@ function flip(e) {
|
||||
|
||||
module.exports = {
|
||||
init: (p = document) => {
|
||||
p.querySelectorAll("[role='switch']").forEach((sw) => {
|
||||
sw.innerHTML = "<span></span>";
|
||||
sw.setAttribute("aria-checked", "false");
|
||||
sw.setAttribute("tabindex", "0");
|
||||
sw.addEventListener("click", flip, false);
|
||||
sw.addEventListener("keypress", flip, false);
|
||||
})
|
||||
try {
|
||||
p.querySelectorAll("[role='switch']").forEach((sw) => {
|
||||
sw.innerHTML = "<span></span>";
|
||||
sw.setAttribute("aria-checked", "false");
|
||||
sw.setAttribute("tabindex", "0");
|
||||
sw.addEventListener("click", flip, false);
|
||||
sw.addEventListener("keypress", flip, false);
|
||||
})
|
||||
} catch (e) {
|
||||
console.warn("Cannot initialise switches.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ block content
|
||||
label(for="example-switch") Switch label (states the on state)
|
||||
span#example-switch(role="switch")
|
||||
|
||||
div#switches.tab-group
|
||||
tabset#switches(order= taborder)
|
||||
pre.language-html(tab="html")
|
||||
include _switch.pug
|
||||
pre.language-pug(tab="pug")
|
||||
@@ -30,7 +30,7 @@ block content
|
||||
div(tab="scss")
|
||||
+h(3)
|
||||
pre.language-sass.
|
||||
@import "scss/core/switch/_switch";
|
||||
@use "scss/core/switch/_switch";
|
||||
@include switch;
|
||||
|
||||
+h(4)
|
||||
|
||||
@@ -1 +1,26 @@
|
||||
[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%)}
|
||||
[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%);
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
@import "_switch.scss";
|
||||
@include switch;
|
||||
@use "_switch.scss";
|
||||
@include switch.switch;
|
||||
@@ -9,26 +9,83 @@ const click = new MouseEvent('click', {
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
export function init(p = document, s = true) {
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
const waitForElement = (selector) => {
|
||||
return new Promise(resolve => {
|
||||
if (document.querySelector(selector)) {
|
||||
return resolve(document.querySelector(selector));
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(mutations => {
|
||||
if (document.querySelector(selector)) {
|
||||
observer.disconnect();
|
||||
resolve(document.querySelector(selector));
|
||||
}
|
||||
});
|
||||
|
||||
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
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"));
|
||||
|
||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||
document.getElementById(tabPanelId).classList.add("open");
|
||||
}
|
||||
|
||||
let pushState = 0;
|
||||
let tabsetCount = 0;
|
||||
|
||||
export function init(container = document, spacer = true, args = {}) {
|
||||
container.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||
if (tabGroup.getAttribute("id") == null) {
|
||||
tabGroup.setAttribute("id", "tab-group-" + tabsetCount);
|
||||
tabsetCount++;
|
||||
}
|
||||
|
||||
const tabgroup = tabGroup.getAttribute("id");
|
||||
let tablist = "";
|
||||
|
||||
Array.from(tabGroup.children).forEach(child => {
|
||||
const tab = child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||
|
||||
// is details?
|
||||
let dtls = child.nodeName == "DETAILS" ? true : false;
|
||||
|
||||
// get the tab text
|
||||
let tab = dtls ? child.querySelector("summary").innerHTML : child.getAttribute("tab") || child.getAttribute("data-tab");
|
||||
|
||||
// if the tab text is not blank
|
||||
if (tab !== null) {
|
||||
const tabID = tab.replace(/\W+/g, "-").toLowerCase();
|
||||
const tabPanel = document.createElement('div');
|
||||
|
||||
|
||||
// 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}`);
|
||||
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>`;
|
||||
tablist += `<li tabindex="0" role="tab" id="tab-${tabgroup}-${tabID}"><span>${tab}</span></li>`;
|
||||
} else {
|
||||
child.classList.add("tab-hidden");
|
||||
}
|
||||
@@ -36,23 +93,40 @@ export function init(p = document, s = true) {
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
ul.setAttribute("role", "tablist");
|
||||
ul.innerHTML = s != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||
ul.innerHTML = spacer != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
tab.addEventListener("click", () => {
|
||||
const siblings = Array.from(tab.parentNode.children);
|
||||
siblings.forEach(sibling => sibling.classList.remove("selected"));
|
||||
tab.classList.add("selected");
|
||||
if ( tabGroup.hasAttribute("order") || tabGroup.hasAttribute("data-order") ) {
|
||||
let order = (tabGroup.getAttribute("order") || tabGroup.getAttribute("data-order")).split(",");
|
||||
|
||||
const tabPanels = Array.from(tab.parentNode.parentNode.children)
|
||||
.filter(child => child.getAttribute("role") === "tabpanel");
|
||||
tabPanels.forEach(panel => panel.classList.remove("open"));
|
||||
const items = Array.from(ul.getElementsByTagName("li"));
|
||||
items.sort((a, b) => {
|
||||
console.log("here")
|
||||
const aa = order.indexOf(a.textContent.trim());
|
||||
const bb = order.indexOf(b.textContent.trim());
|
||||
|
||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||
document.getElementById(tabPanelId).classList.add("open");
|
||||
// Check if both items exist in orderArray
|
||||
if (aa === -1) return 1; // Move to the end if not found
|
||||
if (bb === -1) return -1; // Move to the end if not found
|
||||
|
||||
return aa - bb; // Sort based on the defined order
|
||||
});
|
||||
|
||||
ul.innerHTML = '';
|
||||
items.forEach(item => ul.appendChild(item));
|
||||
}
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
tab.addEventListener("click", (evt) => {
|
||||
if (pushState == 0) {
|
||||
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.parentNode.firstChild.getAttribute("id")}, "", `#${tab.parentNode.firstChild.getAttribute("id")}`);
|
||||
pushState++;
|
||||
}
|
||||
|
||||
chooseTab(evt.currentTarget);
|
||||
window.history.pushState({rand: Math.random(), pushState: pushState, tab: tab.getAttribute("id")}, "", `#${tab.getAttribute("id")}`);
|
||||
pushState++;
|
||||
});
|
||||
|
||||
tab.addEventListener("keypress", (e) => {
|
||||
e.preventDefault();
|
||||
@@ -61,6 +135,24 @@ export function init(p = document, s = true) {
|
||||
}
|
||||
})
|
||||
});
|
||||
ul.querySelector("li").classList.add("selected");
|
||||
}
|
||||
|
||||
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,4 +1,4 @@
|
||||
tabset#uniqueID
|
||||
div(tab="[tab title]")
|
||||
div(tab="[tab title]")
|
||||
tabset#uniqueID(order="tab title 2,tab title 1")
|
||||
div(tab="[tab title 1]")
|
||||
div(tab="[tab title 2]")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tabset#uniqueID
|
||||
div(tab="[tab title]")
|
||||
div(tab="[tab title]")
|
||||
tabset#uniqueID(order="tab title 2,tab title 1")
|
||||
div(tab="[tab title 1]")
|
||||
div(tab="[tab title 2]")
|
||||
|
||||
@@ -1,69 +1,78 @@
|
||||
// DS2 core (c) 2024 Alexander McIlwraith
|
||||
// Licensed under CC BY-SA 4.0
|
||||
|
||||
$tab-border: #7f7f7f !default;
|
||||
$tab-selected: #FFF !default;
|
||||
$tab-notselected: #f0f0f0 !default;
|
||||
|
||||
@mixin tabs {
|
||||
tabset, .tab-group {
|
||||
margin: 2rem 0 1rem 0;
|
||||
> ul {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
li.separator {
|
||||
border-bottom: 1px solid $tab-border;
|
||||
border-left: 1px solid $tab-border;
|
||||
display: inline-block;
|
||||
margin: .45rem 0 0 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-hidden {
|
||||
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"] {
|
||||
background-color: $tab-selected;
|
||||
border: 1px solid $tab-border;
|
||||
border-top: none;
|
||||
padding: 1rem;
|
||||
z-index: 1;
|
||||
|
||||
&:not(.open) {
|
||||
display: none;
|
||||
}
|
||||
@content;
|
||||
|
||||
}
|
||||
}
|
||||
// DS2 core (c) 2024 Alexander McIlwraith
|
||||
// Licensed under CC BY-SA 4.0
|
||||
|
||||
$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-text: #000 !default;
|
||||
$tab-notselected: #f0f0f0 !default;
|
||||
$tab-notselected-text: #000 !default;
|
||||
|
||||
@mixin tabs {
|
||||
tabset, .tab-group {
|
||||
margin: 2rem 0 1rem 0;
|
||||
|
||||
[role="tablist"] {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
|
||||
li {
|
||||
&.separator {
|
||||
border-bottom: 1px solid $tab-border;
|
||||
display: inline-block;
|
||||
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 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[role="tabpanel"] {
|
||||
background-color: $tab-selected;
|
||||
border: 1px solid $tab-border;
|
||||
border-top: none;
|
||||
padding: 1rem;
|
||||
z-index: 1;
|
||||
|
||||
&:not(.open) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,15 @@ block content
|
||||
|
||||
|
||||
+h(2)
|
||||
p The structure of the tab set is defined in html. There are two forms supported. Adding a class of #[code.inline .tab-group] to the container element will work in place of the #[code.inline tabset] tag, and the tab panels can be defined using either #[code.inline tab=""] or #[code.inline data-tab=""]. Passing an optional element to the init function will initialise tabs within that element.
|
||||
p The structure of the tab set is defined in html. There are two forms supported. Adding a class of #[code.inline .tab-group] to the container element will work in place of the #[code.inline tabset] tag, and the tab panels can be defined using either #[code.inline tab=""] or #[code.inline data-tab=""]. Passing an optional element to the init function will initialise tabs within that element. Adding a #[code.inline order=""] or #[code.inline data-order=""] element to the tabset you can have the tabs sorted in a consistent order across tabsets.
|
||||
|
||||
+h(3)
|
||||
pre.language-pug(tab="pug").
|
||||
tabset(order="tab2, tab1")
|
||||
div(tab="tab1")
|
||||
div(tab="tab2")
|
||||
|
||||
tabset#tabs
|
||||
tabset#tabs(order= taborder)
|
||||
pre.language-html(tab="html")
|
||||
include _tabs.pug
|
||||
pre.language-pug(tab="pug")
|
||||
@@ -33,7 +38,7 @@ block content
|
||||
div(tab="scss")
|
||||
+h(3)
|
||||
pre.language-sass.
|
||||
@import "scss/core/tabs/_tabs";
|
||||
@use "scss/core/tabs/_tabs";
|
||||
@include tabs{
|
||||
// optional content block
|
||||
};
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
tabset, .tab-group {
|
||||
margin: 2rem 0 1rem 0;
|
||||
}
|
||||
tabset > ul, .tab-group > ul {
|
||||
tabset [role=tablist], .tab-group [role=tablist] {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
tabset > ul li.separator, .tab-group > ul li.separator {
|
||||
tabset [role=tablist] li.separator, .tab-group [role=tablist] 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] {
|
||||
tabset [role=tablist] li[role=tab], .tab-group [role=tablist] li[role=tab] {
|
||||
background-color: #FFF;
|
||||
border-left: 1px solid #7f7f7f;
|
||||
border-top: 1px solid #7f7f7f;
|
||||
border-right: 1px solid #7f7f7f;
|
||||
border-radius: 0.5rem 0.5rem 0 0;
|
||||
border-top: 1px solid #7f7f7f;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 1rem 1.5rem 0.14rem 1.5rem;
|
||||
z-index: 2;
|
||||
}
|
||||
tabset [role=tab]:last-of-type, .tab-group [role=tab]:last-of-type {
|
||||
tabset [role=tablist] li[role=tab]:last-of-type, .tab-group [role=tablist] li[role=tab]:last-of-type {
|
||||
border-right: 1px solid #7f7f7f;
|
||||
}
|
||||
tabset [role=tab]:not(.selected), .tab-group [role=tab]:not(.selected) {
|
||||
tabset [role=tablist] li[role=tab]:not(.selected), .tab-group [role=tablist] li[role=tab]:not(.selected) {
|
||||
background-color: #f0f0f0;
|
||||
border-bottom: 1px solid #7f7f7f;
|
||||
}
|
||||
tabset [role=tab] span, .tab-group [role=tab] span {
|
||||
tabset [role=tablist] li[role=tab] span, .tab-group [role=tablist] li[role=tab] span {
|
||||
display: block;
|
||||
margin: 0 0 0.5rem 0;
|
||||
}
|
||||
tabset .tab-hidden, .tab-group .tab-hidden {
|
||||
display: none;
|
||||
}
|
||||
tabset [role=tabpanel], .tab-group [role=tabpanel] {
|
||||
background-color: #FFF;
|
||||
border: 1px solid #7f7f7f;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@import "_tabs.scss";
|
||||
@include tabs;
|
||||
@use "_tabs.scss";
|
||||
@include tabs.tabs;
|
||||
@@ -29,6 +29,7 @@ $tooltip-pointer-top: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000
|
||||
background: $tooltip-light-background;
|
||||
border-radius: $tooltip-border-radius;
|
||||
color: $tooltip-light-foreground;
|
||||
display: none;
|
||||
filter: $tooltip-light-drop-shadow;
|
||||
$font-family: $font-body;
|
||||
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;
|
||||
will-change: filter;
|
||||
z-index: 10;
|
||||
|
||||
|
||||
&::before {
|
||||
clip-path: inset(50%);
|
||||
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"]) {
|
||||
position: relative;
|
||||
&:is(:hover, :focus-visible, :active) > [role="tooltip"] {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
transition-delay: 300ms;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ block content
|
||||
include _tooltip.pug
|
||||
|
||||
|
||||
tabset#tooltip
|
||||
tabset#tooltip(order= taborder)
|
||||
pre.language-html(tab="html")
|
||||
include _tooltip.pug
|
||||
pre.language-pug(tab="pug")
|
||||
@@ -43,7 +43,7 @@ block content
|
||||
div(tab="scss")
|
||||
+h(3)
|
||||
pre.language-sass.
|
||||
@import "scss/core/tooltip/_tooltip";
|
||||
@use "scss/core/tooltip/_tooltip";
|
||||
@include tooltip;
|
||||
+h(4)
|
||||
pre.language-sass
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
background: #fff;
|
||||
border-radius: 0.5rem;
|
||||
color: #000;
|
||||
display: none;
|
||||
-webkit-filter: drop-shadow(0 3px 3px hsla(0, 0%, 0%, 0.15)) drop-shadow(0 12px 12px hsla(0, 0%, 0%, 0.15));
|
||||
filter: drop-shadow(0 3px 3px hsla(0, 0%, 0%, 0.15)) drop-shadow(0 12px 12px hsla(0, 0%, 0%, 0.15));
|
||||
font-size: 1rem;
|
||||
@@ -134,6 +135,7 @@
|
||||
position: relative;
|
||||
}
|
||||
:has(> [role=tooltip]):is(:hover, :focus-visible, :active) > [role=tooltip] {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
-webkit-transition-delay: 300ms;
|
||||
transition-delay: 300ms;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//- DS2 core (c) 2024 Alexander McIlwraith
|
||||
//- Licensed under CC BY-SA 4.0
|
||||
|
||||
@import "_tooltip.scss";
|
||||
@include tooltip;
|
||||
@use "_tooltip.scss";
|
||||
@include tooltip.tooltip;
|
||||
@@ -10,6 +10,8 @@
|
||||
*/
|
||||
|
||||
|
||||
@use "../pg/patterns/core/breakpoint/breakpoint";
|
||||
|
||||
@mixin core-colour-samples {
|
||||
|
||||
#copystatus {
|
||||
@@ -48,14 +50,14 @@
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
@include break(-lg) {
|
||||
@include breakpoint.break(-lg) {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@include break(-sm) {
|
||||
@include breakpoint.break(-sm) {
|
||||
grid-template-columns: auto;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
@@ -79,7 +81,7 @@
|
||||
width: 20rem;
|
||||
max-width: 318px;
|
||||
|
||||
@include break(-lg) {
|
||||
@include breakpoint.break(-lg) {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -114,7 +116,7 @@
|
||||
display: grid;
|
||||
gap: .5rem;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: 2.5rem repeat(2, max-content);
|
||||
grid-template-rows: repeat(3, max-content);
|
||||
.result {
|
||||
align-items: center;
|
||||
border-radius: .5rem;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/* ----------------------------------------------------------
|
||||
* Variables
|
||||
*/
|
||||
|
||||
@@ -14,16 +14,27 @@ $tooltip-dark-allow: false;
|
||||
|
||||
// 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
|
||||
// your pattern.
|
||||
@import "core";
|
||||
// your pattern.
|
||||
@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;
|
||||
@@ -32,19 +43,15 @@ $tooltip-dark-allow: false;
|
||||
html {
|
||||
font-family: $font-body;
|
||||
font-size: $font-size;
|
||||
@include break(-md) {
|
||||
@include breakpoint.break(-md) {
|
||||
font-size: calc($font-size + 2pt);
|
||||
}
|
||||
&.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) {
|
||||
display: none;
|
||||
@@ -65,7 +72,7 @@ body {
|
||||
margin: 0 auto;
|
||||
width: 100vw;
|
||||
|
||||
@include header;
|
||||
@include header.header;
|
||||
|
||||
nav {
|
||||
background-color: var(--colour-blue);
|
||||
@@ -84,7 +91,7 @@ body {
|
||||
color: var(--colour-white);
|
||||
text-decoration: none;
|
||||
}
|
||||
@include break(md-) {
|
||||
@include breakpoint.break(md-) {
|
||||
display: initial;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +105,7 @@ body {
|
||||
grid-row: 3;
|
||||
grid-template-columns: auto repeat(2, max-content);
|
||||
text-align: right;
|
||||
@include switch;
|
||||
@include switch.switch;
|
||||
label {
|
||||
text-align: left;;
|
||||
}
|
||||
@@ -109,7 +116,7 @@ body {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 4;
|
||||
|
||||
@include break(-md) {
|
||||
@include breakpoint.break(-md) {
|
||||
grid-row: 3;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -117,7 +124,7 @@ body {
|
||||
@supports(grid-area: auto) {
|
||||
display: grid;
|
||||
grid-template-columns: 1rem repeat(2, auto) 1rem;
|
||||
@include break(md-) {
|
||||
@include breakpoint.break(md-) {
|
||||
grid-template-columns: auto repeat(2, 22rem) auto;
|
||||
}
|
||||
}
|
||||
@@ -135,7 +142,7 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@include tabs {
|
||||
@include tabs.tabs {
|
||||
pre {
|
||||
background-color: var(--colour-black-5);
|
||||
font-size: .8rem;
|
||||
@@ -150,15 +157,12 @@ body {
|
||||
display: grid;
|
||||
grid-gap: .5rem;
|
||||
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