govuk_frontend_toolkit 1.6.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,8 @@
1
+ # 1.7.0
2
+
3
+ - Create new grid helpers for creating grid layouts
4
+ - The old grid mixins; `@outer-block` and `@inner-block` are now deprecated
5
+
1
6
  # 1.6.2
2
7
 
3
8
  - Reset font family for print stylesheets to fix print errors in browsers and printers
data/app/assets/README.md CHANGED
@@ -99,32 +99,56 @@ In production:
99
99
 
100
100
  ### <a id="grid-layout"></a>Grid layout
101
101
 
102
- Use `.outer-block` and `.inner-block` together.
102
+ Grid helpers to enable easy cross browser grids. The grids use absolute widths
103
+ in older versions of IE or percentage based widths in modern browsers.
103
104
 
104
- Outer block sets a max width of 1020px,
105
- auto margins and a minimum width for IE8 and below.
105
+ - `%site-width-container` creates a 960px wide elastic container for you site content block
106
+ - `%grid-row` container for a row of columns
107
+ - `@mixin grid-column($width, $full-width: tablet)` a mixin to create grid columns of fraction width
106
108
 
107
- Inner block sets gutters to align with the header and footer.
109
+ These three grid helpers are designed to be used together and aren't guaranteed
110
+ to work or behave in a predictable way if used in isolation.
108
111
 
109
- Use within banners, or to set a max-width for your main content area,
110
- with padding that matches the header and footer.
112
+ There is also an `%outdent-to-full-width` selector which can be extended to
113
+ outdent and element and cause it to take up the edge gutters and butt up to the
114
+ edge of smaller screens.
111
115
 
112
- ##### Usage
116
+ #### Usage:
113
117
 
114
- .outer-block {
115
- @include outer-block;
116
- }
118
+ ```
119
+ #page-container {
120
+ @extend %site-width-container;
121
+ }
122
+ .grid-row {
123
+ @extend %grid-row;
117
124
 
118
- .inner-block {
119
- @include inner-block;
120
- }
125
+ .column-third {
126
+ @include grid-column( 1/3 );
127
+ }
128
+ .column-two-thirds {
129
+ @include grid-column( 2/3 );
130
+ }
131
+ }
132
+ .hero-image {
133
+ @extend %outdent-to-full-width;
134
+ }
121
135
 
122
136
 
123
- <div class="outer-block">
124
- <div class="inner-block">
125
- Content in here
126
- </div>
137
+ <div id="page-container">
138
+ <div class="grid-row">
139
+ <div class="column-two-thirds">
140
+ Main content
127
141
  </div>
142
+ <div class="column-third">
143
+ Sidebar
144
+ </div>
145
+ </div>
146
+
147
+ <div class="hero-image">
148
+ <img ...>
149
+ </div>
150
+ </div>
151
+ ```
128
152
 
129
153
  ### <a id="conditionals"></a>Conditionals
130
154
 
@@ -1 +1 @@
1
- 1.6.2
1
+ 1.7.0
@@ -2,8 +2,121 @@
2
2
  @import '_measurements.scss';
3
3
  @import '_shims.scss';
4
4
 
5
+ $site-width: 960px;
6
+
7
+ // An extendable selector to wrap your entire site content block
8
+ // It limits the sites width to be 960px wide and maintains consistent margins
9
+ // on the site of the page and shrinks the margins for mobile.
10
+ //
11
+ // Usage:
12
+ //
13
+ // #page-container {
14
+ // @extend %site-width-container;
15
+ // }
16
+
17
+ %site-width-container {
18
+ max-width: $site-width;
19
+ @include ie-lte(8){
20
+ width: $site-width;
21
+ }
22
+
23
+ margin: 0 $gutter-half;
24
+ @include media(tablet){
25
+ margin: 0 $gutter;
26
+ }
27
+ @include media($min-width: ($site-width + $gutter * 2), $ignore-for-ie: true){
28
+ margin: 0 auto;
29
+ }
30
+ }
31
+
32
+ // An extendable selector to outdent to the full page-width
33
+ // So that you can create elements that take up the gutters on the side of the
34
+ // page and butt up to the edge of the browser on smaller screens (rather than
35
+ // leaving a gutter at the edge of the page).
36
+ //
37
+ // Usage:
38
+ //
39
+ // .hero-image-container {
40
+ // @extend %outdent-to-full-width;
41
+ // }
42
+ %outdent-to-full-width {
43
+ margin-left: -$gutter-half;
44
+ margin-left: -$gutter-half;
45
+ @include media(tablet){
46
+ margin-left: -$gutter;
47
+ margin-right: -$gutter;
48
+ }
49
+ }
50
+
51
+ //
52
+ // Usage:
53
+ //
54
+ // .grid-row {
55
+ // @extend %grid-row;
56
+ // }
57
+
58
+ %grid-row {
59
+ @extend %contain-floats;
60
+ margin: 0 (-$gutter-half);
61
+ }
62
+
63
+ // An extendable selector to define a row for grid columns to sit in
64
+ //
65
+ // Usage:
66
+ //
67
+ // .grid-row {
68
+ // @extend %grid-row;
69
+ // }
70
+
71
+ %grid-row {
72
+ @extend %contain-floats;
73
+ margin: 0 (-$gutter-half);
74
+ }
75
+
76
+ // A mixin for a grid column
77
+ // Creates a cross browser grid column with a standardised gutter between the
78
+ // columns. Widths should be defined as fractions of the full desktop width
79
+ // they want to fill. By default they break to become full width at tablet size
80
+ // but that can be configured to be dektop using the `$full-width` argument.
81
+ //
82
+ // Usage:
83
+ //
84
+ // .column-quarter {
85
+ // @include grid-column( 1/4 );
86
+ // }
87
+ // .column-half {
88
+ // @include grid-column( 1/2 );
89
+ // }
90
+ // .column-third {
91
+ // @include grid-column( 1/3 );
92
+ // }
93
+ // .column-two-thirds {
94
+ // @include grid-column( 2/3 );
95
+ // }
96
+ // .column-desktop-third {
97
+ // @include grid-column( 1/3, $full-width: desktop );
98
+ // }
99
+
100
+ @mixin grid-column($width, $full-width: tablet) {
101
+ @include media($full-width){
102
+ float: left;
103
+ width: percentage($width);
104
+ }
105
+ @include ie-lte(7){
106
+ width: (($site-width + $gutter) * $width) - $gutter;
107
+ }
108
+
109
+ padding: 0 $gutter-half;
110
+ box-sizing: border-box;
111
+ }
112
+
113
+
114
+ // OLD depricated grid mixins
115
+ // You should migrate to the mixins above in the future
116
+
5
117
  // Outer block sets a max width
6
118
  @mixin outer-block {
119
+ @warn "The @mixin outer-block is depricated and should be updated to new grid helpers";
7
120
  margin: 0 auto;
8
121
  width: auto;
9
122
  max-width: 960 + $gutter*2;
@@ -13,15 +126,10 @@
13
126
  }
14
127
  }
15
128
 
16
- // Outer block usage:
17
- //
18
- // .outer-block {
19
- // @include outer-block;
20
- // }
21
-
22
129
  // Inner block sets either margin or padding
23
130
  // to align content with header and footer
24
131
  @mixin inner-block($margin-or-padding: padding) {
132
+ @warn "The @mixin inner-block is depricated and should be updated to use new grid helpers";
25
133
  #{$margin-or-padding}-left: $gutter-half;
26
134
  #{$margin-or-padding}-right: $gutter-half;
27
135
  @include media(tablet) {
@@ -29,15 +137,3 @@
29
137
  #{$margin-or-padding}-right: $gutter;
30
138
  }
31
139
  }
32
-
33
- // Inner block usage:
34
- //
35
- // By default, inner block sets padding
36
- // .inner-block {
37
- // @include inner-block;
38
- // }
39
- //
40
- // To set margins instead of padding:
41
- // .inner-block {
42
- // @include inner-block(margin);
43
- // }
data/jenkins.sh CHANGED
@@ -26,7 +26,7 @@ bundle exec rake
26
26
  # If the submodule has a new version string
27
27
  if [ "$PINNED_SUBMODULE_VERSION" != "$NEW_SUBMODULE_VERSION" ]; then
28
28
  # Commit the updated submodule and push it to origin
29
- git commit -am "Bump to version $PINNED_SUBMODULE_VERSION"
29
+ git commit -am "Bump to version $NEW_SUBMODULE_VERSION"
30
30
  git push origin master
31
31
  fi
32
32
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_frontend_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-29 00:00:00.000000000 Z
12
+ date: 2014-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &6425400 !ruby/object:Gem::Requirement
16
+ requirement: &11490340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *6425400
24
+ version_requirements: *11490340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sass
27
- requirement: &6424820 !ruby/object:Gem::Requirement
27
+ requirement: &11489600 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.2.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *6424820
35
+ version_requirements: *11489600
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: gem_publisher
38
- requirement: &6424300 !ruby/object:Gem::Requirement
38
+ requirement: &11488780 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.3.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *6424300
46
+ version_requirements: *11488780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &6423720 !ruby/object:Gem::Requirement
49
+ requirement: &11487900 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - =
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.9.2.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *6423720
57
+ version_requirements: *11487900
58
58
  description:
59
59
  email: bradley.wright@digital.cabinet-office.gov.uk
60
60
  executables: []
@@ -254,7 +254,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
254
  version: '0'
255
255
  segments:
256
256
  - 0
257
- hash: 3672654523895780324
257
+ hash: 1154536810056934077
258
258
  required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  none: false
260
260
  requirements:
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  segments:
265
265
  - 0
266
- hash: 3672654523895780324
266
+ hash: 1154536810056934077
267
267
  requirements: []
268
268
  rubyforge_project:
269
269
  rubygems_version: 1.8.11