govuk_frontend_toolkit 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -51,14 +51,8 @@ conditionals and typography mixins you should add:
51
51
 
52
52
  ## Updating the version of the toolkit that's included with the gem
53
53
 
54
- 1. Find the commit of [the toolkit][govuk_frontend_toolkit] you want to update to. In this
55
- repository, `cd app/assets` and then run `git checkout <NEW TOOLKIT COMMIT>` to change
56
- the git submodule
57
- 2. Update the version number in `lib/govuk_frontend_toolkit/version.rb`
58
- 3. Commit those two changes together and push them.
59
-
60
- Do not create a version tag in this repository - that's handled automatically by the
61
- job that publishes the gem to RubyGems.
54
+ You shouldn't need to touch this repository. New versions are published automatically
55
+ based on the `VERSION.txt` in [the frontend toolkit repo][govuk_frontend_toolkit].
62
56
 
63
57
  ## Licence
64
58
 
@@ -1,2 +1,4 @@
1
1
  node_modules/
2
2
  .sass-cache
3
+
4
+ /spec/stylesheets/test-out.css.map
@@ -0,0 +1,107 @@
1
+ linters:
2
+ BangFormat:
3
+ enabled: true
4
+
5
+ DuplicateProperty:
6
+ enabled: true
7
+
8
+ EmptyRule:
9
+ enabled: true
10
+
11
+ FinalNewline:
12
+ enabled: true
13
+
14
+ Indentation:
15
+ character: space
16
+ enabled: true
17
+ exclude:
18
+ - 'stylesheets/_css3.scss'
19
+
20
+ MergeableSelector:
21
+ enabled: true
22
+
23
+ PropertySpelling:
24
+ enabled: true
25
+
26
+ SingleLinePerProperty:
27
+ enabled: true
28
+
29
+ TrailingSemicolon:
30
+ enabled: true
31
+
32
+ UrlFormat:
33
+ enabled: true
34
+
35
+ UrlQuotes:
36
+ enabled: true
37
+
38
+ # Disabled rules
39
+
40
+ BorderZero:
41
+ enabled: false
42
+ ColorKeyword:
43
+ enabled: false
44
+ Comment:
45
+ enabled: false
46
+ Compass Linters:
47
+ enabled: false
48
+ DebugStatement:
49
+ enabled: false
50
+ DeclarationOrder:
51
+ enabled: false
52
+ ElsePlacement:
53
+ enabled: false
54
+ EmptyLineBetweenBlocks:
55
+ enabled: false
56
+ HexLength:
57
+ enabled: false
58
+ HexNotation:
59
+ enabled: false
60
+ HexValidation:
61
+ enabled: false
62
+ IdWithExtraneousSelector:
63
+ enabled: false
64
+ ImportPath:
65
+ enabled: false
66
+ LeadingZero:
67
+ enabled: false
68
+ NameFormat:
69
+ enabled: false
70
+ NestingDepth:
71
+ enabled: false
72
+ PlaceholderInExtend:
73
+ enabled: false
74
+ PropertySortOrder:
75
+ enabled: false
76
+ QualifyingElement:
77
+ enabled: false
78
+ SelectorDepth:
79
+ enabled: false
80
+ SelectorFormat:
81
+ enabled: false
82
+ Shorthand:
83
+ enabled: false
84
+ SingleLinePerSelector:
85
+ enabled: false
86
+ SpaceAfterComma:
87
+ enabled: false
88
+ SpaceAfterPropertyColon:
89
+ enabled: false
90
+ SpaceAfterPropertyName:
91
+ enabled: false
92
+ SpaceBeforeBrace:
93
+ enabled: false
94
+ SpaceBetweenParens:
95
+ enabled: false
96
+ StringQuotes:
97
+ enabled: false
98
+ TrailingZero:
99
+ enabled: false
100
+ UnnecessaryMantissa:
101
+ enabled: false
102
+ UnnecessaryParentReference:
103
+ enabled: false
104
+ VendorPrefixes:
105
+ enabled: false
106
+ ZeroUnit:
107
+ enabled: false
@@ -4,4 +4,4 @@ node_js:
4
4
  rvm:
5
5
  - 2.1.0
6
6
  before_install:
7
- - gem install sass
7
+ - bundle install
@@ -1,3 +1,11 @@
1
+ # 3.1.0
2
+
3
+ - Fix: outdent to add right margin rather than only left
4
+ - Fix: add missing semi-colons in JavaScript files
5
+ - Fix: use box-sizing mixin in column mixin to support more browsers
6
+ - Add: ability to specify float direction on column mixin
7
+ - Add: Sass-lint tests
8
+
1
9
  # 3.0.1
2
10
 
3
11
  - Fix a bug with the npm publishing. npm requires a version change to publish a package.
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'sass', '3.4.9'
4
+ gem 'scss-lint', '0.30.0'
@@ -50,11 +50,24 @@ module.exports = function(grunt) {
50
50
  style: 'nested',
51
51
  }
52
52
  },
53
+ },
54
+ scsslint: {
55
+ allFiles: [
56
+ 'stylesheets/*.scss',
57
+ 'stylesheets/**/*.scss'
58
+ ],
59
+ options: {
60
+ bundleExec: true,
61
+ config: '.scss-lint.yaml'
62
+ }
53
63
  }
54
64
  });
65
+
55
66
  grunt.loadNpmTasks('grunt-contrib-clean');
56
67
  grunt.loadNpmTasks('grunt-contrib-jasmine');
57
68
  grunt.loadNpmTasks('grunt-contrib-sass');
58
- grunt.registerTask('test', ['sass', 'clean', 'jasmine']);
69
+ grunt.loadNpmTasks('grunt-scss-lint');
70
+
71
+ grunt.registerTask('test', ['sass', 'clean', 'jasmine', 'scsslint']);
59
72
  grunt.registerTask('default', ['test']);
60
73
  };
data/app/assets/README.md CHANGED
@@ -1,7 +1,14 @@
1
- # GOV.UK Frontend Toolkit
1
+ # GOV.UK frontend toolkit
2
2
 
3
- A collection of Sass and Javascript tools for generating frontend
4
- code.
3
+ A collection of Sass and JavaScript files for using as part of your
4
+ application's frontend.
5
+
6
+ This project is not tied to a specific language and is designed to be used
7
+ as a dependency in as many different languages as needed.
8
+
9
+ There's a `Gemfile` and a `package.json` in this directory, but they are only
10
+ for running tests and are not an indication that this project prefers
11
+ Ruby or Node.js.
5
12
 
6
13
  ## Installing
7
14
 
@@ -37,7 +44,7 @@ You can include the toolkit as a [git submodule][].
37
44
 
38
45
  To add the submodule to your project run the following command substituting the path to a subdirectory in your project's assets directory:
39
46
 
40
- $ git submodule add https://github.com/alphagov/govuk_frontend_toolkit.git ./path/to/assets/govuk_toolkit
47
+ $ git submodule add https://github.com/alphagov/govuk_frontend_toolkit.git ./path/to/assets/govuk_frontend_toolkit
41
48
 
42
49
  We recommend you use `https` rather than `ssh` for submodules as they don't require key exchanges when deploying to remote servers.
43
50
 
@@ -51,10 +58,16 @@ To update the toolkit to the latest version you can use:
51
58
 
52
59
  ## Running tests
53
60
 
54
- Install Node 0.8 or higher and PhantomJS.
61
+ Tests for this project use Jasmine for the JavaScript and Ruby's `scss` and `scss-lint`
62
+ to check the stylesheets.
55
63
 
56
- $ npm install
57
- $ npm test
64
+ The requirements are Node.js 0.8 or higher and PhantomJS, and Ruby:
65
+
66
+ ```bash
67
+ bundle install
68
+ npm install
69
+ npm test
70
+ ```
58
71
 
59
72
  ### Using the local test runner
60
73
 
@@ -79,11 +92,11 @@ If you are compiling Sass from the [command-line tool](http://sass-lang.com/docs
79
92
 
80
93
  In development:
81
94
 
82
- sass --style expanded --line-numbers --load-path [path to]/govuk_toolkit/stylesheets input.scss output.css
95
+ sass --style expanded --line-numbers --load-path [path to]/govuk_frontend_toolkit/stylesheets input.scss output.css
83
96
 
84
97
  In production:
85
98
 
86
- sass --style compressed --load-path [path to]/govuk_toolkit/stylesheets input.scss output.css
99
+ sass --style compressed --load-path [path to]/govuk_frontend_toolkit/stylesheets input.scss output.css
87
100
 
88
101
 
89
102
 
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.1.0
@@ -11,7 +11,7 @@
11
11
  this.addToggleLink();
12
12
  this.hideExtraLinks();
13
13
  }
14
- }
14
+ };
15
15
  PrimaryList.prototype = {
16
16
  toggleText: function(){
17
17
  if(this.$extraLinks.length > 1){
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  addToggleLink: function(){
24
- this.$toggleLink = $('<a href="#">'+ this.toggleText() + '</a>')
24
+ this.$toggleLink = $('<a href="#">'+ this.toggleText() + '</a>');
25
25
  this.$toggleLink.click($.proxy(this.toggleLinks, this));
26
26
  this.$toggleLink.insertAfter(this.$el);
27
27
  },
@@ -32,11 +32,11 @@
32
32
  },
33
33
  hideExtraLinks: function(){
34
34
  this.$extraLinks.addClass('visuallyhidden');
35
- $(window).trigger('govuk.pageSizeChanged')
35
+ $(window).trigger('govuk.pageSizeChanged');
36
36
  },
37
37
  showExtraLinks: function(){
38
38
  this.$extraLinks.removeClass('visuallyhidden');
39
- $(window).trigger('govuk.pageSizeChanged')
39
+ $(window).trigger('govuk.pageSizeChanged');
40
40
  }
41
41
  };
42
42
  GOVUK.PrimaryList = PrimaryList;
@@ -47,5 +47,5 @@
47
47
  new GOVUK.PrimaryList(el, selector);
48
48
  });
49
49
  }
50
- }
50
+ };
51
51
  }());
@@ -1,5 +1,5 @@
1
1
  (function () {
2
- "use strict"
2
+ "use strict";
3
3
  var root = this,
4
4
  $ = root.jQuery;
5
5
 
@@ -52,7 +52,7 @@
52
52
  var radioName;
53
53
 
54
54
  if ($elm.attr('type') === 'radio') {
55
- radioName = $elm.attr('name'),
55
+ radioName = $elm.attr('name');
56
56
  $($elm[0].form).find('input[name="' + radioName + '"]')
57
57
  .parent('label')
58
58
  .removeClass(this.selectedClass);
@@ -87,7 +87,7 @@
87
87
  }.bind(this);
88
88
  };
89
89
  SelectionButtons.prototype.getFocusHandler = function (opts) {
90
- var focusEvent = (opts.level === 'document') ? 'focusin' : 'focus'
90
+ var focusEvent = (opts.level === 'document') ? 'focusin' : 'focus';
91
91
 
92
92
  return function (e) {
93
93
  var state = (e.type === focusEvent) ? 'focused' : 'blurred';
@@ -1,5 +1,5 @@
1
1
  (function () {
2
- "use strict"
2
+ "use strict";
3
3
  var root = this,
4
4
  $ = root.jQuery;
5
5
  if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }
@@ -71,6 +71,6 @@
71
71
  $el.siblings('.shim').remove();
72
72
  }
73
73
  }
74
- }
74
+ };
75
75
  root.GOVUK.stickAtTopWhenScrolling = sticky;
76
76
  }).call(this);
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
  (function () {
15
- "use strict"
15
+ "use strict";
16
16
  var root = this,
17
17
  $ = root.jQuery;
18
18
  if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }
@@ -8,6 +8,7 @@
8
8
  "grunt-contrib-clean":"~0.6.0",
9
9
  "grunt-contrib-jasmine": "~0.5.2",
10
10
  "grunt-contrib-sass": "0.7.4",
11
+ "grunt-scss-lint": "0.3.4",
11
12
  "jquery-browser": "~1.7.2-3"
12
13
  },
13
14
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  (function (root) {
2
- "use strict"
2
+ "use strict";
3
3
  var loadedScripts = 0,
4
4
  totalScripts,
5
5
  merge,
@@ -39,7 +39,7 @@
39
39
  return script;
40
40
  };
41
41
  runJasmine = function () {
42
- var console_reporter = new jasmine.ConsoleReporter()
42
+ var console_reporter = new jasmine.ConsoleReporter();
43
43
  jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
44
44
  jasmine.getEnv().addReporter(console_reporter);
45
45
  jasmine.getEnv().execute();
@@ -47,7 +47,6 @@ describe("MultivariateTest", function() {
47
47
  GOVUK.cookie.andReturn('foo');
48
48
  var test = new GOVUK.MultivariateTest({
49
49
  name: 'stuff',
50
- customVarIndex: 1,
51
50
  cohorts: {
52
51
  foo: {},
53
52
  bar: {}
@@ -116,7 +115,7 @@ describe("MultivariateTest", function() {
116
115
  },
117
116
  runImmediately: false
118
117
  });
119
- test.fooCallback = jasmine.createSpy('fooCallback')
118
+ test.fooCallback = jasmine.createSpy('fooCallback');
120
119
  test.run();
121
120
  expect(test.fooCallback).toHaveBeenCalled();
122
121
  });
@@ -585,7 +585,7 @@ describe("selection-buttons", function () {
585
585
  $radioButtons = $("label.selectable input[type='radio']");
586
586
  $radioLabels = $radioButtons.parent('label');
587
587
  $radioButtons.eq(0).focus();
588
- expect($radioLabels.eq(0).hasClass('focused')).toBe(true)
588
+ expect($radioLabels.eq(0).hasClass('focused')).toBe(true);
589
589
  });
590
590
 
591
591
  it("Should add a custom focused class to the radio if sent in as an option", function () {
@@ -598,7 +598,7 @@ describe("selection-buttons", function () {
598
598
  $radioButtons = $("label.selectable input[type='radio']");
599
599
  $radioLabels = $radioButtons.parent('label');
600
600
  $radioButtons.eq(0).focus();
601
- expect($radioLabels.eq(0).hasClass('selectable-focused')).toBe(true)
601
+ expect($radioLabels.eq(0).hasClass('selectable-focused')).toBe(true);
602
602
  });
603
603
 
604
604
  it("Should remove the focused class from a radio when it loses focus", function () {
@@ -611,9 +611,9 @@ describe("selection-buttons", function () {
611
611
  $radioButtons = $("label.selectable input[type='radio']");
612
612
  $radioLabels = $radioButtons.parent('label');
613
613
  $radioButtons.eq(0).focus();
614
- expect($radioLabels.eq(0).hasClass('focused')).toBe(true)
614
+ expect($radioLabels.eq(0).hasClass('focused')).toBe(true);
615
615
  $radioButtons.eq(0).blur();
616
- expect($radioLabels.eq(0).hasClass('focused')).toBe(false)
616
+ expect($radioLabels.eq(0).hasClass('focused')).toBe(false);
617
617
  });
618
618
  });
619
619
  });
@@ -1,4 +1,5 @@
1
1
  @import '_conditionals.scss';
2
+ @import '_css3.scss';
2
3
  @import '_measurements.scss';
3
4
  @import '_shims.scss';
4
5
 
@@ -41,7 +42,7 @@ $site-width: 960px;
41
42
  // }
42
43
  %outdent-to-full-width {
43
44
  margin-left: -$gutter-half;
44
- margin-left: -$gutter-half;
45
+ margin-right: -$gutter-half;
45
46
  @include media(tablet){
46
47
  margin-left: -$gutter;
47
48
  margin-right: -$gutter;
@@ -85,9 +86,9 @@ $site-width: 960px;
85
86
  // @include grid-column( 1/3, $full-width: desktop );
86
87
  // }
87
88
 
88
- @mixin grid-column($width, $full-width: tablet) {
89
+ @mixin grid-column($width, $full-width: tablet, $float: left) {
89
90
  @include media($full-width){
90
- float: left;
91
+ float: $float;
91
92
  width: percentage($width);
92
93
  }
93
94
  @include ie-lte(7){
@@ -95,7 +96,7 @@ $site-width: 960px;
95
96
  }
96
97
 
97
98
  padding: 0 $gutter-half;
98
- box-sizing: border-box;
99
+ @include box-sizing(border-box);
99
100
  }
100
101
 
101
102
 
@@ -235,7 +235,7 @@ $is-print: false !default;
235
235
  }
236
236
 
237
237
  @if $top-hover == top {
238
- $top-hover: $top
238
+ $top-hover: $top;
239
239
  }
240
240
 
241
241
  &:hover:after {
@@ -118,16 +118,20 @@
118
118
 
119
119
  .muted {
120
120
  color: $light-blue;
121
+
122
+ ~ * {
123
+ opacity: 0.333;
124
+ }
125
+
126
+ ~ .vol-display {
127
+ text-decoration: line-through;
128
+ }
121
129
  }
122
130
 
123
131
  .muted::after {
124
132
  content: "d";
125
133
  }
126
134
 
127
- .muted ~ * {
128
- opacity: 0.333;
129
- }
130
-
131
135
  .vol-down, .vol-up {
132
136
  position: absolute;
133
137
  bottom: 0;
@@ -171,10 +175,6 @@
171
175
  background-position: center left;
172
176
  background-image: file-url('player-icon-volume.png');
173
177
  }
174
-
175
- .muted ~ .vol-display {
176
- text-decoration: line-through;
177
- }
178
178
  }
179
179
 
180
180
  .current-time {
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: 3.0.1
4
+ version: 3.1.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-11-21 00:00:00.000000000 Z
12
+ date: 2014-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &10600520 !ruby/object:Gem::Requirement
16
+ requirement: &11238300 !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: *10600520
24
+ version_requirements: *11238300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sass
27
- requirement: &10620160 !ruby/object:Gem::Requirement
27
+ requirement: &11236700 !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: *10620160
35
+ version_requirements: *11236700
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: gem_publisher
38
- requirement: &10619560 !ruby/object:Gem::Requirement
38
+ requirement: &11235360 !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: *10619560
46
+ version_requirements: *11235360
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &10618980 !ruby/object:Gem::Requirement
49
+ requirement: &11234200 !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: *10618980
57
+ version_requirements: *11234200
58
58
  description:
59
59
  email: bradley.wright@digital.cabinet-office.gov.uk
60
60
  executables: []
@@ -74,9 +74,12 @@ files:
74
74
  - lib/govuk_frontend_toolkit/engine.rb
75
75
  - lib/govuk_frontend_toolkit/version.rb
76
76
  - app/assets/.gitignore
77
+ - app/assets/.scss-lint.yaml
77
78
  - app/assets/.travis.yml
78
79
  - app/assets/CHANGELOG.md
79
80
  - app/assets/CONTRIBUTING.md
81
+ - app/assets/Gemfile
82
+ - app/assets/Gemfile.lock
80
83
  - app/assets/Gruntfile.js
81
84
  - app/assets/LICENCE
82
85
  - app/assets/README.md
@@ -254,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
257
  version: '0'
255
258
  segments:
256
259
  - 0
257
- hash: -2986948619087384107
260
+ hash: -4114693619292822888
258
261
  required_rubygems_version: !ruby/object:Gem::Requirement
259
262
  none: false
260
263
  requirements:
@@ -263,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
266
  version: '0'
264
267
  segments:
265
268
  - 0
266
- hash: -2986948619087384107
269
+ hash: -4114693619292822888
267
270
  requirements: []
268
271
  rubyforge_project:
269
272
  rubygems_version: 1.8.11