diff --git a/app/styles/index.scss b/app/styles/index.scss index 88e5a36..1015493 100644 --- a/app/styles/index.scss +++ b/app/styles/index.scss @@ -35,10 +35,11 @@ @import '../../node_modules/picnic/src/plugins/modal/plugin'; // @import '../../node_modules/picnic/src/plugins/dropimage/plugin'; -// @import '../../node_modules/picnic/src/plugins/tabs/plugin'; +@import '../../node_modules/picnic/src/plugins/tabs/plugin'; @import '../../node_modules/picnic/src/plugins/tooltip/plugin'; // Custom global styling +@import './picnic-customizations/tabs'; @import './picnic-customizations/custom'; // View styling diff --git a/app/styles/picnic-customizations/_tabs.scss b/app/styles/picnic-customizations/_tabs.scss new file mode 100644 index 0000000..21a897e --- /dev/null +++ b/app/styles/picnic-customizations/_tabs.scss @@ -0,0 +1,42 @@ +$tabs: five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty; + +.tabs { + &.one { + > .row { + width: 100%; + left: 0; + } + + > input:nth-of-type(1):checked ~ .row { + margin-left: 0; + } + + > label img { + display: none; + } + } + + // This is probably really stupid, but whatever. I need more than the 4 built-in tabs that Picnic provides + @for $tab-index from 1 through length($tabs) { + $number: $tab-index + 4; + $tab: nth($tabs, $tab-index); + + &.#{$tab} { + > .row { + width: 100% * $number; + left: -100% * ($number - 1); + } + + @for $item from 1 through ($number - 1) { + > input:nth-of-type(#{$item}):checked ~ .row { + margin-left: (100% * ($number - 1)) - (100% * ($item - 1));// 400%; + } + } + + > label img { + width: floor(100% / $number) - 2%; + margin: 4% 0 4% 4%; + } + } + } +} \ No newline at end of file diff --git a/app/views/partials/modal.js b/app/views/partials/modal.js index a9d8ceb..f9ae7c3 100644 --- a/app/views/partials/modal.js +++ b/app/views/partials/modal.js @@ -10,6 +10,8 @@ export const modal = (modalId, controller, contentHTML, options = {}) => { * headerText : Displayed in an `

` if no header is specified * noFooter : Set to `true` and exclude footerHTML to not include a modal footer * footerHTML : Displayed in place of the default footer; Recommended to use `