Skip to content

Commit

Permalink
Merge pull request #2376 from alphagov/support-release-3.14.0
Browse files Browse the repository at this point in the history
Release 3.14.0
  • Loading branch information
Vanita Barrett committed Oct 4, 2021
2 parents 0bd698c + ae6fecf commit 8feaca8
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13.1
3.14.0

Large diffs are not rendered by default.

File renamed without changes.

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion package/govuk/components/panel/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@
text-align: center;

@include govuk-media-query($until: tablet) {
padding: govuk-spacing(6) - $govuk-border-width;
padding: govuk-spacing(3) - $govuk-border-width;

// This is an if-all-else-fails attempt to stop long words from overflowing the container
// on very narrow viewports by forcing them to break and wrap instead. This
// overflowing is more likely to happen when user increases text size on a mobile eg. using
// iOS Safari text resize controls.
//
// The overflowing is a particular problem with the panel component since it uses white
// text: when the text overflows the container, it is invisible on the white (page)
// background. When the text in our other components overflow, the user might have to scroll
// horizontally to view it but the the text remains legible.
overflow-wrap: break-word;
word-wrap: break-word; // Support IE (autoprefixer doesn't add this as it's not a prefix)
}
}

Expand Down
26 changes: 22 additions & 4 deletions package/govuk/helpers/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@
///
/// Returns measurement corresponding to the spacing point requested.
///
/// @param {Number} $spacing-point - Point on the spacing scale (set in `settings/_spacing.sccs`)
/// @param {Number} $spacing-point - Point on the spacing scale
/// (set in `settings/_spacing.scss`)
///
/// @returns {String} Spacing Measurement eg. 10px
/// @returns {String} Spacing measurement eg. 10px
///
/// @example scss
/// .element {
/// padding: govuk-spacing(5);
/// top: govuk-spacing(2) !important; // if `!important` is required
/// }
///
/// @example scss Using negative spacing
/// .element {
/// margin-top: govuk-spacing(-1);
/// }
///
/// @example scss Marking spacing declarations as important
/// .element {
/// margin-top: govuk-spacing(1) !important;
/// }
///
/// @access public

@function govuk-spacing($spacing-point) {
Expand All @@ -27,11 +38,18 @@
+ "#{$actual-input-type}.";
}

$is-negative: false;
@if ($spacing-point < 0) {
$is-negative: true;
$spacing-point: abs($spacing-point);
}

@if not map-has-key($govuk-spacing-points, $spacing-point) {
@error "Unknown spacing variable `#{$spacing-point}`. Make sure you are using a point from the spacing scale in `_settings/spacing.scss`.";
}

@return map-get($govuk-spacing-points, $spacing-point);
$value: map-get($govuk-spacing-points, $spacing-point);
@return if($is-negative, $value * -1, $value);
}

/// Responsive spacing
Expand Down
1 change: 1 addition & 0 deletions package/govuk/overrides/_all.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "display";
@import "spacing";
@import "text-align";
@import "typography";
@import "width";
20 changes: 20 additions & 0 deletions package/govuk/overrides/_text-align.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

// stylelint-disable declaration-no-important
@include govuk-exports("govuk/overrides/text-align") {
.govuk-\!-text-align-left {
text-align: left !important;
}

.govuk-\!-text-align-centre {
text-align: center !important;
}

.govuk-\!-text-align-right {
text-align: right !important;
}
}
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "govuk-frontend",
"description": "GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.",
"version": "3.13.1",
"version": "3.14.0",
"main": "govuk/all.js",
"sass": "govuk/all.scss",
"engines": {
Expand Down

0 comments on commit 8feaca8

Please sign in to comment.