diff --git a/docs/_javascript/playground.js b/docs/_javascript/playground.js new file mode 100644 index 00000000..2b5a967c --- /dev/null +++ b/docs/_javascript/playground.js @@ -0,0 +1,23 @@ +document.addEventListener("DOMContentLoaded", () => { + const $grid = document.getElementById("grid"); + const $columns = document.querySelectorAll(".jsColumns"); + + $columns.forEach(($) => + $.addEventListener( + "input", + (event) => { + const count = event.target.valueAsNumber; + const suffix = event.target.dataset.suffix; + console.log("Column count", count); + $grid.className = `grid has-${count}-cols${suffix}`; + const $columnsCount = getAll("strong", $.parentNode); + $columnsCount.innerHTML = count; + }, + false + ) + ); + + function getAll(selector, parent = document) { + return Array.prototype.slice.call(parent.querySelectorAll(selector), 0); + } +}); diff --git a/docs/cyp/grid/grid.html b/docs/cyp/grid/grid.html index 46c8c698..b5b38fdd 100644 --- a/docs/cyp/grid/grid.html +++ b/docs/cyp/grid/grid.html @@ -1,27 +1,70 @@ --- layout: cypress title: Grid/Grid +breakpoints: +- name: mobile + visibility: mobile + count: 2 + suffix: '-mobile' +- name: tablet + visibility: tablet-only + count: 4 + suffix: '-tablet' +- name: desktop + visibility: desktop-only + count: 8 + suffix: '-desktop' +- name: widescreen + visibility: widescreen-only + count: 12 + suffix: '-widescreen' +- name: fullhd + visibility: fullhd + count: 16 + suffix: '-fullhd' --- -
{{ breakpoint.count }} columns on {{ breakpoint.name }}
+ +