govuk_frontend_toolkit 1.1.0 → 1.2.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,45 +1,67 @@
1
- // CSS 3 Mixins
1
+ // CSS 3 mixins
2
2
 
3
- // Add them as you need them. This should let us manage vendor prefixes in one place.
3
+ // This file includes mixins for CSS properties that require vendor prefixes.
4
4
 
5
+ // Please add more mixins here as you need them, rather than adding them to
6
+ // your application - this lets us manage them in one place.
7
+
8
+ // You can use the @warn directive to deprecate a mixin where the property
9
+ // no longer needs prefixes.
5
10
 
6
11
  @mixin border-radius($radius) {
7
- -webkit-border-radius: $radius;
8
- -moz-border-radius: $radius;
12
+ -webkit-border-radius: $radius; // Chrome 4.0, Safari 3.1 to 4.0, Mobile Safari 3.2, Android Browser 2.1
13
+ -moz-border-radius: $radius; // Firefox 2.0 to 3.6
9
14
  border-radius: $radius;
10
15
  }
16
+
11
17
  @mixin box-shadow($shadow) {
12
- -webkit-box-shadow: $shadow;
13
- -moz-box-shadow: $shadow;
18
+ -webkit-box-shadow: $shadow; // Chrome 4.0 to 9.0, Safari 3.1 to 5.0, Mobile Safari 3.2 to 4.3, Android Browser 2.1 to 3.0
19
+ -moz-box-shadow: $shadow; // Firefox 3.5 to 3.6
14
20
  box-shadow: $shadow;
15
21
  }
22
+
23
+ @mixin scale($x, $y) {
24
+ // $x and $y should be numeric values without units
25
+ -webkit-transform: scale($x, $y); // Still in use now, started at: Chrome 4.0, Safari 3.1, Mobile Safari 3.2, Android 2.1
26
+ -moz-transform: scale($x, $y); // Firefox 3.5 to 15.0
27
+ -ms-transform: scale($x, $y); // IE9 only
28
+ -o-transform: scale($x, $y); // Opera 10.5 to 12.0
29
+ transform: scale($x, $y);
30
+ }
31
+
16
32
  @mixin translate($x, $y) {
17
- -webkit-transform: translate($x, $y);
18
- -moz-transform: translate($x, $y);
19
- -o-transform: translate($x, $y);
33
+ -webkit-transform: translate($x, $y); // Still in use now, started at: Chrome 4.0, Safari 3.1, Mobile Safari 3.2, Android 2.1
34
+ -moz-transform: translate($x, $y); // Firefox 3.5 to 15.0
35
+ -ms-transform: translate($x, $y); // IE9 only
36
+ -o-transform: translate($x, $y); // Opera 10.5 to 12.0
20
37
  transform: translate($x, $y);
21
38
  }
22
39
 
23
40
  @mixin gradient($from, $to) {
24
- background-color: $from; // fallback/image non-cover color
25
- background-image: -moz-linear-gradient($from, $to); // Firefox 3.6+
26
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to)); // Safari 4+, Chrome 1+
27
- background-image: -webkit-linear-gradient($from, $to); // Safari 5.1+, Chrome 10+
28
- background-image: -o-linear-gradient($from, $to); // Opera 11.10+
29
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{$from}', endColorstr='#{$to}',GradientType=0 ); // IE6-9
41
+ // Creates a vertical gradient where $from is the colour at the top of the element
42
+ // and $to is the colour at the bottom. The top colour is used as a background-color
43
+ // for browsers that don't support gradients.
44
+ background-color: $from;
45
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to)); // Safari 4.0 to 5.1, Chrome 1.0 to 10.0, old deprecated syntax
46
+ background-image: -webkit-linear-gradient($from, $to); // Chrome 10.0 to 25.0, Safari 5.1 to 6.0, Mobile Safari 5.0 to 6.1, Android Browser 4.0 to 4.3
47
+ background-image: -moz-linear-gradient($from, $to); // Firefox 3.6 to 15.0
48
+ background-image: -o-linear-gradient($from, $to); // Opera 11.1 to 12.0
49
+ background-image: linear-gradient($from, $to);
50
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{$from}', endColorstr='#{$to}',GradientType=0 ); // IE6 to IE9
30
51
  }
31
52
 
32
53
  @mixin transition($property, $duration, $function, $delay: 0s) {
33
- -webkit-transition: ($property $duration $function $delay);
34
- -moz-transition: ($property $duration $function $delay);
35
- -ms-transition: ($property $duration $function $delay);
36
- -o-transition: ($property $duration $function $delay);
54
+ -webkit-transition: ($property $duration $function $delay); // Chrome 4.0 to 25.0, Safari 3.1 to 6.0, Mobile Safari 3.2 to 6.1, Android Browser 2.1 to 4.3
55
+ -moz-transition: ($property $duration $function $delay); // Firefox 4.0 to 15.0
56
+ -o-transition: ($property $duration $function $delay); // Opera 10.5 to 12.0
37
57
  transition: ($property $duration $function $delay);
38
58
  }
39
59
 
40
- @mixin box-sizing($type) { // Acceptable values are border, content, and padding - content is the default W3C model
41
- -webkit-box-sizing: $type;
42
- -moz-box-sizing: $type;
60
+ @mixin box-sizing($type) {
61
+ // http://www.w3.org/TR/css3-ui/#box-sizing
62
+ // $type can be one of: content-box | padding-box | border-box | inherit
63
+ -webkit-box-sizing: $type; // Chrome 4.0 to 9.0, Safari 3.1 to 5.0, Mobile Safari 3.2 to 4.3, Android Browser 2.1 to 3.0
64
+ -moz-box-sizing: $type; // Firefox 2.0 to 28.0, Firefox for Android 26.0 onwards
43
65
  box-sizing: $type;
44
66
  }
45
67
 
@@ -49,13 +71,12 @@
49
71
  }
50
72
 
51
73
  @mixin calc($property, $calc) {
52
- #{$property}: -webkit-calc(#{$calc});
53
- #{$property}: calc(#{$calc});
74
+ #{$property}: -webkit-calc(#{$calc}); // Chrome 19.0 to 25.0, Safari 6.0, Mobile Safari 6.0 to 6.1
75
+ #{$property}: calc(#{$calc});
54
76
  }
55
77
 
56
78
  @mixin opacity($trans) {
57
79
  zoom: 1;
58
- filter: unquote('alpha(opacity=' + ($trans * 100) + ')');
80
+ filter: unquote('alpha(opacity=' + ($trans * 100) + ')'); // IE6 to IE8
59
81
  opacity: $trans;
60
82
  }
61
-
@@ -19,18 +19,25 @@
19
19
  // @include outer-block;
20
20
  // }
21
21
 
22
- // Inner block sets gutters to align content with header and footer
23
- @mixin inner-block {
24
- padding-left: $gutter-half;
25
- padding-right: $gutter-half;
22
+ // Inner block sets either margin or padding
23
+ // to align content with header and footer
24
+ @mixin inner-block($margin-or-padding: padding) {
25
+ #{$margin-or-padding}-left: $gutter-half;
26
+ #{$margin-or-padding}-right: $gutter-half;
26
27
  @include media(tablet) {
27
- padding-left: $gutter;
28
- padding-right: $gutter;
28
+ #{$margin-or-padding}-left: $gutter;
29
+ #{$margin-or-padding}-right: $gutter;
29
30
  }
30
31
  }
31
32
 
32
33
  // Inner block usage:
33
34
  //
35
+ // By default, inner block sets padding
34
36
  // .inner-block {
35
37
  // @include inner-block;
36
38
  // }
39
+ //
40
+ // To set margins instead of padding:
41
+ // .inner-block {
42
+ // @include inner-block(margin);
43
+ // }
@@ -5,6 +5,7 @@ $one-quarter: $full-width/4;
5
5
  $one-third: $full-width/3;
6
6
  $half: $full-width/2;
7
7
  $two-thirds: ($full-width)-($one-third);
8
+ $three-quarters: ($full-width)-($one-quarter);
8
9
 
9
10
  $gutter: 30px;
10
11
  $gutter-one-quarter: $gutter/4;
@@ -27,7 +27,7 @@
27
27
  // Size and shape
28
28
  position: relative;
29
29
  @include inline-block;
30
- padding: 0.35em 0.5em 0.15em 0.5em;
30
+ padding: 0.3em 0.6em 0.2em 0.6em;
31
31
  border: none;
32
32
  @include border-radius(0);
33
33
  -webkit-appearance: none;
@@ -110,7 +110,7 @@
110
110
  &:active:before {
111
111
  top: -10%;
112
112
  height: 120%;
113
-
113
+
114
114
  // IE6 ignores the :before psuedo-class but applies the block to :active
115
115
  // It therefore needs to be reset
116
116
  @include ie(6) {
@@ -1,3 +1,3 @@
1
1
  module GovUKFrontendToolkit
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
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.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-28 00:00:00.000000000 Z
12
+ date: 2014-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -264,7 +264,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
264
  version: '0'
265
265
  segments:
266
266
  - 0
267
- hash: 1729454393941465233
267
+ hash: 4354231487439092246
268
268
  required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  none: false
270
270
  requirements:
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  version: '0'
274
274
  segments:
275
275
  - 0
276
- hash: 1729454393941465233
276
+ hash: 4354231487439092246
277
277
  requirements: []
278
278
  rubyforge_project:
279
279
  rubygems_version: 1.8.23