govuk_frontend_toolkit 1.3.0 → 1.4.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.
- data/app/assets/Gruntfile.js +1 -1
- data/app/assets/README.md +36 -23
- data/app/assets/images/icon-important.png +0 -0
- data/app/assets/spec/MultivariateTestSpec.js +3 -3
- data/app/assets/stylesheets/design-patterns/_alpha-beta.scss +45 -29
- data/lib/govuk_frontend_toolkit/version.rb +1 -1
- metadata +4 -4
data/app/assets/Gruntfile.js
CHANGED
data/app/assets/README.md
CHANGED
@@ -605,55 +605,68 @@ The button text colour is set by the mixin to either light or dark, depending on
|
|
605
605
|
|
606
606
|
If you're applying these styles to non form elements, adding a class of 'disabled' to the element will emulate the disabled button style.
|
607
607
|
|
608
|
-
### <a id="alpha-beta"></a>Alpha/Beta
|
609
608
|
|
610
|
-
|
609
|
+
### <a id="alpha-beta"></a> Phase banner
|
611
610
|
|
612
|
-
|
611
|
+
A mixin to create a GOV.UK Phase banner, with alpha/beta tag inside.
|
612
|
+
|
613
|
+
#### Description
|
613
614
|
|
614
615
|
`@mixin phase-banner($state)`
|
615
|
-
`@mixin phase-tag($state)`
|
616
616
|
|
617
|
-
|
617
|
+
`$state` is either `alpha` or `beta`.
|
618
618
|
|
619
|
-
`$state`
|
619
|
+
`$state` sets the background colour of the phase tag to the appropriate alpha or beta colour.
|
620
620
|
|
621
|
-
#####
|
621
|
+
##### Phase banner - Alpha
|
622
622
|
|
623
|
-
.
|
623
|
+
.phase-banner {
|
624
624
|
@include phase-banner(alpha);
|
625
625
|
}
|
626
626
|
|
627
|
-
<div class="
|
628
|
-
<
|
629
|
-
<
|
630
|
-
|
631
|
-
|
632
|
-
</div>
|
627
|
+
<div class="phase-banner">
|
628
|
+
<p>
|
629
|
+
<strong class="phase-tag">ALPHA</strong>
|
630
|
+
<span>This is a new service – your <a href="#">feedback</a> will help us to improve it.</span>
|
631
|
+
</p>
|
633
632
|
</div>
|
634
633
|
|
635
|
-
|
634
|
+
##### Phase banner - Beta
|
635
|
+
|
636
|
+
.phase-banner {
|
636
637
|
@include phase-banner(beta);
|
637
638
|
}
|
638
639
|
|
639
|
-
<div class="
|
640
|
-
<
|
641
|
-
<
|
642
|
-
|
643
|
-
|
644
|
-
</div>
|
640
|
+
<div class="phase-banner">
|
641
|
+
<p>
|
642
|
+
<strong class="phase-tag">BETA</strong>
|
643
|
+
<span>This is a new service – your <a href="#">feedback</a> will help us to improve it.</span>
|
644
|
+
</p>
|
645
645
|
</div>
|
646
646
|
|
647
|
+
### <a id="phase-tags"></a> Phase tags
|
647
648
|
|
648
|
-
|
649
|
+
A mixin to create an alpha/beta tag.
|
650
|
+
|
651
|
+
#### Description
|
652
|
+
|
653
|
+
`@mixin phase-tag($state)`
|
654
|
+
|
655
|
+
`$state` is either `alpha` or `beta`.
|
656
|
+
|
657
|
+
`$state` sets the background colour of the phase tag to the appropriate alpha or beta colour.
|
658
|
+
|
659
|
+
##### Phase tag - Alpha
|
649
660
|
|
650
661
|
.alpha-tag{
|
651
662
|
@include phase-tag(alpha);
|
652
663
|
}
|
653
664
|
<h2>
|
654
|
-
Apply using the new service <span class="
|
665
|
+
Apply using the new service <span class="alpha-tag">ALPHA</span>
|
655
666
|
</h2>
|
656
667
|
|
668
|
+
##### Phase tag - Beta
|
669
|
+
|
657
670
|
.beta-tag{
|
658
671
|
@include phase-tag(beta);
|
659
672
|
}
|
Binary file
|
@@ -83,7 +83,7 @@ describe("MultivariateTest", function() {
|
|
83
83
|
cohorts: {
|
84
84
|
foo: {html: "foo"},
|
85
85
|
bar: {html: "bar"}
|
86
|
-
}
|
86
|
+
}
|
87
87
|
});
|
88
88
|
expect($el.html()).toEqual('foo');
|
89
89
|
});
|
@@ -100,7 +100,7 @@ describe("MultivariateTest", function() {
|
|
100
100
|
cohorts: {
|
101
101
|
foo: {callback: fooSpy},
|
102
102
|
bar: {callback: barSpy}
|
103
|
-
}
|
103
|
+
}
|
104
104
|
});
|
105
105
|
expect(barSpy).toHaveBeenCalled();
|
106
106
|
});
|
@@ -131,7 +131,7 @@ describe("MultivariateTest", function() {
|
|
131
131
|
cohorts: {
|
132
132
|
foo: {callback: fooSpy},
|
133
133
|
bar: {callback: barSpy}
|
134
|
-
}
|
134
|
+
}
|
135
135
|
});
|
136
136
|
if (GOVUK.cookie.argsForCall[1][1] == 'foo') {
|
137
137
|
expect(fooSpy).toHaveBeenCalled();
|
@@ -3,57 +3,73 @@
|
|
3
3
|
@import "../_shims";
|
4
4
|
@import "../_grid_layout";
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
background-color: $alpha-colour;
|
12
|
-
} @else if $state == beta {
|
13
|
-
background-color: $beta-colour;
|
14
|
-
}
|
6
|
+
// Phase banner usage:
|
7
|
+
//
|
8
|
+
// .phase-banner {
|
9
|
+
// @include phase-banner($state: beta);
|
10
|
+
// }
|
15
11
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
// Inner block sets gutters to align content with header and footer
|
22
|
-
.inner-block {
|
23
|
-
@include inner-block;
|
12
|
+
@mixin phase-banner($state: alpha) {
|
13
|
+
padding: 10px 0 8px 0;
|
14
|
+
@include media(tablet) {
|
15
|
+
padding-bottom: 10px;
|
24
16
|
}
|
17
|
+
border-bottom: 1px solid $border-colour;
|
25
18
|
|
26
|
-
// No need to set a max-width for content inside .inner-block
|
27
19
|
p {
|
28
20
|
margin: 0;
|
29
21
|
color: $banner-text-colour;
|
30
22
|
@include core-16;
|
31
23
|
}
|
32
24
|
|
33
|
-
|
34
|
-
|
25
|
+
.phase-tag {
|
26
|
+
@include phase-tag($state);
|
35
27
|
}
|
36
28
|
|
37
|
-
|
38
|
-
|
29
|
+
span {
|
30
|
+
@include inline-block;
|
31
|
+
width: 75%;
|
32
|
+
vertical-align: top;
|
33
|
+
|
34
|
+
@include media(tablet) {
|
35
|
+
width: auto;
|
36
|
+
vertical-align: baseline;
|
37
|
+
}
|
39
38
|
}
|
40
39
|
}
|
41
40
|
|
41
|
+
// Phase tag usage:
|
42
|
+
//
|
43
|
+
// Alpha
|
44
|
+
// .phase-tag {
|
45
|
+
// @include phase-tag;
|
46
|
+
// }
|
47
|
+
//
|
48
|
+
// Beta
|
49
|
+
// .phase-tag {
|
50
|
+
// @include phase-tag(beta);
|
51
|
+
// }
|
52
|
+
|
42
53
|
@mixin phase-tag($state: alpha) {
|
43
54
|
@include inline-block;
|
55
|
+
vertical-align: top;
|
44
56
|
|
45
|
-
@
|
46
|
-
|
47
|
-
} @else if $state == beta {
|
48
|
-
background-color: $beta-colour;
|
57
|
+
@include media(tablet){
|
58
|
+
vertical-align: baseline;
|
49
59
|
}
|
50
60
|
|
51
|
-
|
61
|
+
margin: 0 8px 0 0;
|
62
|
+
padding: 2px 5px 0;
|
63
|
+
|
52
64
|
@include bold-16($line-height: 20/16);
|
53
65
|
text-transform: uppercase;
|
54
66
|
letter-spacing: 1px;
|
55
67
|
text-decoration: none;
|
56
68
|
|
57
|
-
|
58
|
-
|
69
|
+
color: #fff;
|
70
|
+
@if $state == alpha {
|
71
|
+
background-color: $alpha-colour;
|
72
|
+
} @else if $state == beta {
|
73
|
+
background-color: $beta-colour;
|
74
|
+
}
|
59
75
|
}
|
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.
|
4
|
+
version: 1.4.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-06-
|
12
|
+
date: 2014-06-26 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: -
|
267
|
+
hash: -3563452542867821047
|
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: -
|
276
|
+
hash: -3563452542867821047
|
277
277
|
requirements: []
|
278
278
|
rubyforge_project:
|
279
279
|
rubygems_version: 1.8.23
|