gel-typography 5.1.2 → 6.0.0-beta.1

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.
Files changed (34) hide show
  1. package/.editorconfig +1 -1
  2. package/README.md +17 -11
  3. package/_typography.scss +596 -34
  4. package/jest.config.mjs +5 -0
  5. package/package.json +9 -10
  6. package/prettier.config.mjs +6 -0
  7. package/src/gel-typography.scss +4 -10
  8. package/test/__snapshots__/typography.test.js.snap +1733 -0
  9. package/test/data/large-type-sizes/atlas.scss +7 -0
  10. package/test/data/large-type-sizes/elephant.scss +7 -0
  11. package/test/data/large-type-sizes/foolscap.scss +7 -0
  12. package/test/data/large-type-sizes/imperial.scss +7 -0
  13. package/test/data/large-type-sizes/royal.scss +7 -0
  14. package/test/data/type-sizes/body-copy.scss +5 -0
  15. package/test/data/type-sizes/brevier.scss +5 -0
  16. package/test/data/type-sizes/canon.scss +5 -0
  17. package/test/data/type-sizes/double-pica.scss +5 -0
  18. package/test/data/type-sizes/great-primer.scss +5 -0
  19. package/test/data/type-sizes/long-primer.scss +5 -0
  20. package/test/data/type-sizes/minion.scss +5 -0
  21. package/test/data/type-sizes/paragon.scss +5 -0
  22. package/test/data/type-sizes/pica.scss +5 -0
  23. package/test/data/type-sizes/trafalgar.scss +5 -0
  24. package/test/data/with-large-fonts.scss +4 -0
  25. package/test/data/without-large-fonts.scss +3 -0
  26. package/test/setup-jest.js +7 -0
  27. package/test/typography.test.js +107 -0
  28. package/.travis.yml +0 -21
  29. package/lib/_settings.scss +0 -420
  30. package/lib/_tools.scss +0 -151
  31. package/test/test-with-large-fonts-expected.css +0 -843
  32. package/test/test-with-large-fonts.scss +0 -20
  33. package/test/test-without-large-fonts-expected.css +0 -558
  34. package/test/test-without-large-fonts.scss +0 -24
package/.editorconfig CHANGED
@@ -7,7 +7,7 @@ root = true
7
7
  [*]
8
8
  charset = utf-8
9
9
  end_of_line = lf
10
- indent_size = 4
10
+ indent_size = 2
11
11
  indent_style = space
12
12
  insert_final_newline = true
13
13
  trim_trailing_whitespace = true
package/README.md CHANGED
@@ -1,12 +1,22 @@
1
1
  <h1 align="center">GEL Typography</h1>
2
- <p align="center">
3
- <a href="https://travis-ci.org/bbc/gel-typography" target="_blank"><img src="https://travis-ci.org/bbc/gel-typography.svg?branch=master"></a>
4
- </p>
5
2
  <p align="center">
6
3
  A flexible code implementation of the GEL Typography.<br />
7
4
  Forms part of the <a href="https://github.com/bbc/gel-foundations" target="_blank"><b>GEL Foundations</b></a>
8
5
  </p>
9
6
 
7
+ ## Breaking Change: v6.0.0
8
+
9
+ ### @import, @use and @forward
10
+
11
+ The `@import` directive is now deprecated in favour of `@use` and `@forward`, see [SASS documentation](https://sass-lang.com/documentation/at-rules/use/) for more information.
12
+
13
+ GEL Typography has now been updated to `@use` and `@forward` to remove a large number of deprecation notices.
14
+
15
+ With the new @use directive, no var, function, or mixin is placed in global scope, and they are all scoped within the file.
16
+
17
+ This means that users will explicitly need to include the partial file in each file that may use its vars, functions or mixins.
18
+
19
+
10
20
  ## What is this?
11
21
 
12
22
  An implementation of the [GEL Typography Guidelines](http://www.bbc.co.uk/gel/guidelines/typography).
@@ -43,14 +53,12 @@ $ npm install --save gel-typography
43
53
 
44
54
  ```sass
45
55
  // your-app/main.scss
46
- @import 'node_modules/gel-sass-tools/sass-tools';
47
- @import 'node_modules/sass-mq/mq';
48
- @import 'node_modules/gel-typography/typography';
56
+ @use 'node_modules/gel-typography/typography';
49
57
  ```
50
58
 
51
59
  ### Install manually
52
60
 
53
- You can install this component manually by downloading the content of this Git repo into your project and use a Sass @import to include it in your project.
61
+ You can install this component manually by downloading the content of this Git repo into your project and use a Sass @use to include it in your project.
54
62
 
55
63
  > **Note:** you will manually need to manage the dependencies below, without these this component will fail to compile.
56
64
 
@@ -77,14 +85,12 @@ By default the GEL Typography component does not output any markup but exposes a
77
85
  }
78
86
  ```
79
87
 
80
- A collection of typography classes can be output by defining `$gel-type-enable--markup-output: true;` before you `@import` the typography partial.
88
+ A collection of typography classes can be output by defining `$gel-type-enable--markup-output: true;` as you `@use` the typography partial.
81
89
 
82
90
  **Example:**
83
91
 
84
92
  ```scss
85
- $gel-type-enable--markup-output: true;
86
-
87
- @import "gel-typography/typography";
93
+ @use "gel-typography/typography" with ($gel-type-enable--markup-output: true);
88
94
  ```
89
95
 
90
96
  The following configurable options are available: