diff --git a/dev/scss/_create.scss b/dev/scss/_create.scss index 4e659b7b0..d20577ded 100755 --- a/dev/scss/_create.scss +++ b/dev/scss/_create.scss @@ -25,6 +25,37 @@ $form-element-end-group-spacing: 32px; } +/* START special styles to imitate bootstrap so that item order is correct for screen readers :-/ */ + +/* Custom row for the layout */ +.bs-create__row { + position: relative; +} + +/* Custom class for main content */ +.bs-create__main { + width: 66.66%; + float: left; +} + +/* Custom class for sidebar */ +.bs-create__sidebox { + position: absolute; + padding-top: 28px; + padding-right: 30px; + right: 0; + top: 0; + width: 31.2%; +} + +/* Clear the floated/absolute positioning below the row */ +.bs-fieldset-stacked { + width: 100%; + float: left; +} + +/* END special styles to imitate bootstrap so that item order is correct for screen readers :-/ */ + .create__radio-button { margin: 0 0 $form-element-group-spacing 45px; } diff --git a/dev/scss/_tab.scss b/dev/scss/_tab.scss index 391cd017e..8050d3914 100755 --- a/dev/scss/_tab.scss +++ b/dev/scss/_tab.scss @@ -26,10 +26,10 @@ .tab__label { margin: 0 10px 0 0; padding: 0.5em 10px; - border: 1px solid $design-light-gray-border-color; - background: $design-white-color; - color: $design-primary-color; - font-size: 1.2em; + border: 1px solid $design-light-gray-border-color; + background: $design-white-color; + color: $design-primary-color; + font-size: 1.2em; font-weight: normal; cursor: pointer; z-index: 1; @@ -58,3 +58,90 @@ } } + +/* trying to get tabs that work well if not ordered in some weird way which makes accessibility bad */ + +/* General tab container styling */ +.tabsnew { + display: flex; + flex-direction: column; + width: 100%; + max-width: 600px; + margin: 0 auto; + overflow: hidden; + font-family: Arial, sans-serif; +} + +/* Tab header container */ +.tabnew__header { + display: flex; + flex-direction: row; + justify-content: flex-start; /* Align tabs to the left */ + border-bottom: 1px solid #ccc; +} + +/* Hide radio inputs */ +.tabnew__input { + display: none; +} + +/* Tab labels */ +.tabnew__label { + display: inline-flex; + margin: 0 10px 0 0; + padding: 0.5em 10px; + border: 1px solid $design-light-gray-border-color; + background: $design-white-color; + color: $design-primary-color; + font-size: 1.2em; + font-weight: normal; + cursor: pointer; + z-index: 1; + + @include bp(screen2) { + padding: 0.5em 30px; + } + + &:not(:first-of-type) { + margin-left: -1px; + } +} + +.tabnew__label:hover { + background: #e0e0e0; +} + +/* Active tab label styling */ +.tabnew__input:checked + .tabnew__label { + border-bottom: 1px solid $design-light-gray-bg-color; + background: $design-light-gray-bg-color; + color: $design-black-color; + + + .tabnew__content { + display: block; + } +} + +/* Tab content */ +.tabnew__content { + position: relative; + width: 100%; + margin-top: -2px; + padding: 10px; + border: 1px solid $design-light-gray-border-color; + background: $design-light-gray-bg-color; + + @include bp(screen2) { + padding: 30px; + } +} + +.tabnew__input:checked + .tabnew__label + .tabnew__content { + display: block; +} + +/* Accessibility improvements */ +.tabnew__label:focus { + outline: 2px solid $design-mark-color +} + diff --git a/static_src/javascripts/advanced_create.js b/static_src/javascripts/advanced_create.js index ea22647bd..856e96ba5 100644 --- a/static_src/javascripts/advanced_create.js +++ b/static_src/javascripts/advanced_create.js @@ -108,7 +108,7 @@ $(document).ready(function() { frm.attr('action', location.pathname + '?publish=' + $("[name='publish']").val() + '&remainder=' + $("#remainder").val()); if (includeAnchor) { - var input = $("", { type: "hidden", name: "anchor", value: "create__publish" }); + var input = $("", { type: "hidden", name: "anchor", value: "current_profile" }); frm.append($(input)); } frm.unbind('submit'); diff --git a/static_src/javascripts/simple_create.js b/static_src/javascripts/simple_create.js index 6d10c1a6c..c0cf7a734 100644 --- a/static_src/javascripts/simple_create.js +++ b/static_src/javascripts/simple_create.js @@ -39,10 +39,7 @@ $(document).ready(function() { actTab2(); } }); -/* ToDo: Bring in both simple and advanced content onto the same page - (and simultaneously define role=tab in HTML) - Then this JavaScript will be unnecessary since tabs will swap quickly - btwn simple/advanced content */ + $('#tab-2:not(:checked)').on('change', function() { actTab2(); }); diff --git a/static_src/stylesheets/main2.min.css b/static_src/stylesheets/main2.min.css index c48eadda7..7d60e31ce 100644 --- a/static_src/stylesheets/main2.min.css +++ b/static_src/stylesheets/main2.min.css @@ -1805,6 +1805,91 @@ Selector pattern using above mixin: .tab__content { padding: 30px; } } +/* trying to get tabs that work well if not ordered in some weird way which makes accessibility bad */ +/* General tab container styling */ +.tabsnew { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + width: 100%; + max-width: 600px; + margin: 0 auto; + overflow: hidden; + font-family: Arial, sans-serif; } + +/* Tab header container */ +.tabnew__header { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + /* Align tabs to the left */ + border-bottom: 1px solid #ccc; } + +/* Hide radio inputs */ +.tabnew__input { + display: none; } + +/* Tab labels */ +.tabnew__label { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + margin: 0 10px 0 0; + padding: 0.5em 10px; + border: 1px solid #beb6af; + background: white; + color: #005f70; + font-size: 1.2em; + font-weight: normal; + cursor: pointer; + z-index: 1; } + @media (min-width: 768px) { + .tabnew__label { + padding: 0.5em 30px; } } + .tabnew__label:not(:first-of-type) { + margin-left: -1px; } + +.tabnew__label:hover { + background: #e0e0e0; } + +/* Active tab label styling */ +.tabnew__input:checked + .tabnew__label { + border-bottom: 1px solid #f9f8f7; + background: #f9f8f7; + color: black; } + .tabnew__input:checked + .tabnew__label + .tabnew__content { + display: block; } + +/* Tab content */ +.tabnew__content { + position: relative; + width: 100%; + margin-top: -2px; + padding: 10px; + border: 1px solid #beb6af; + background: #f9f8f7; } + @media (min-width: 768px) { + .tabnew__content { + padding: 30px; } } + +.tabnew__input:checked + .tabnew__label + .tabnew__content { + display: block; } + +/* Accessibility improvements */ +.tabnew__label:focus { + outline: 2px solid #fbb714; } + .table1 { width: 100%; border-collapse: collapse; } @@ -2059,6 +2144,31 @@ Selector pattern using above mixin: .create__sidebox { padding: 0 0 20px 20px; } } +/* START special styles to imitate bootstrap so that item order is correct for screen readers :-/ */ +/* Custom row for the layout */ +.bs-create__row { + position: relative; } + +/* Custom class for main content */ +.bs-create__main { + width: 66.66%; + float: left; } + +/* Custom class for sidebar */ +.bs-create__sidebox { + position: absolute; + padding-top: 28px; + padding-right: 30px; + right: 0; + top: 0; + width: 31.2%; } + +/* Clear the floated/absolute positioning below the row */ +.bs-fieldset-stacked { + width: 100%; + float: left; } + +/* END special styles to imitate bootstrap so that item order is correct for screen readers :-/ */ .create__radio-button { margin: 0 0 20px 45px; } diff --git a/templates/create/_datacite_title.html b/templates/create/_datacite_title.html index ea7d01493..1d0a335ab 100644 --- a/templates/create/_datacite_title.html +++ b/templates/create/_datacite_title.html @@ -23,7 +23,7 @@ {% if forloop.counter == 1 %} {% include "create/_datacite_inlinetext.html" with field=t_field reqd="true" %} {% elif forloop.counter == 2 %} -