govuk_frontend_toolkit 0.45.0 → 0.46.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -391,6 +391,11 @@ After setting the default, apply includes from the following for different font
391
391
 
392
392
  `external-link-heading` is a unique style a background image for headings to groups of external links.
393
393
 
394
+ This uses the `file-url` helper which will by default output an `image-url` to
395
+ be used with Compass or Rails Asset Pipeline, if you want to use a static path
396
+ then set the `$path` variable to point to the public location of the toolkit
397
+ image assets.
398
+
394
399
  #### Description
395
400
 
396
401
  For a set style:
@@ -1,6 +1,7 @@
1
1
  @import '_font_stack.scss';
2
2
  @import '_conditionals.scss';
3
3
  @import '_device-pixels.scss';
4
+ @import '_url-helpers.scss';
4
5
 
5
6
  // GOV.UK typography palettes
6
7
 
@@ -377,11 +378,11 @@ $is-print: false !default;
377
378
 
378
379
  @mixin external-link-default {
379
380
  &:after {
380
- background-image: image-url("external-links/external-link.png");
381
+ background-image: file-url("external-links/external-link.png");
381
382
  background-repeat: no-repeat;
382
383
 
383
384
  @include device-pixel-ratio() {
384
- background-image: image-url("external-links/external-link-24x24.png");
385
+ background-image: file-url("external-links/external-link-24x24.png");
385
386
  background-size: 12px 400px;
386
387
  }
387
388
  }
@@ -389,11 +390,11 @@ $is-print: false !default;
389
390
 
390
391
  @mixin external-link-heading {
391
392
  &:after {
392
- background-image: image-url("external-links/external-link-black-12x12.png");
393
+ background-image: file-url("external-links/external-link-black-12x12.png");
393
394
  background-repeat: no-repeat;
394
395
 
395
396
  @include device-pixel-ratio() {
396
- background-image: image-url("external-links/external-link-black-24x24.png");
397
+ background-image: file-url("external-links/external-link-black-24x24.png");
397
398
  background-size: 12px 400px;
398
399
  }
399
400
  }
@@ -0,0 +1,16 @@
1
+ // URL Helpers
2
+
3
+ $path: false !default;
4
+
5
+ // A function which can either output a image-url to be used with the Rails
6
+ // Asset Pipeline or Compass or a plain url which is prefixed with a defined
7
+ // path variable.
8
+ @function file-url($file) {
9
+ $url: '';
10
+ @if $path {
11
+ $url: url($path+$file);
12
+ } @else {
13
+ $url: image-url($file);
14
+ }
15
+ @return $url;
16
+ }
@@ -1,3 +1,3 @@
1
1
  module GovUKFrontendToolkit
2
- VERSION = "0.45.0"
2
+ VERSION = "0.46.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: 0.45.0
4
+ version: 0.46.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-03-21 00:00:00.000000000 Z
12
+ date: 2014-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -223,6 +223,7 @@ files:
223
223
  - app/assets/stylesheets/_measurements.scss
224
224
  - app/assets/stylesheets/_shims.scss
225
225
  - app/assets/stylesheets/_typography.scss
226
+ - app/assets/stylesheets/_url-helpers.scss
226
227
  - app/assets/stylesheets/design-patterns/_alpha-beta.scss
227
228
  - app/assets/stylesheets/design-patterns/_buttons.scss
228
229
  - app/assets/stylesheets/design-patterns/_media-player.scss
@@ -242,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
243
  version: '0'
243
244
  segments:
244
245
  - 0
245
- hash: 623435425171733917
246
+ hash: 1757367347862365382
246
247
  required_rubygems_version: !ruby/object:Gem::Requirement
247
248
  none: false
248
249
  requirements:
@@ -251,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
252
  version: '0'
252
253
  segments:
253
254
  - 0
254
- hash: 623435425171733917
255
+ hash: 1757367347862365382
255
256
  requirements: []
256
257
  rubyforge_project:
257
258
  rubygems_version: 1.8.23