{"id":18376867,"url":"https://github.com/bbc/gel-typography","last_synced_at":"2025-12-29T13:45:42.464Z","repository":{"id":15859171,"uuid":"18599541","full_name":"bbc/gel-typography","owner":"bbc","description":"A flexible code implementation of the GEL Typography Guidelines","archived":false,"fork":false,"pushed_at":"2025-05-06T13:01:21.000Z","size":591,"stargazers_count":115,"open_issues_count":0,"forks_count":11,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-05-06T13:31:19.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bbc.github.io/gel-typography/","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-04-09T14:07:29.000Z","updated_at":"2025-05-06T13:01:24.000Z","dependencies_parsed_at":"2024-01-12T11:53:17.029Z","dependency_job_id":"c4f1b86f-efb6-40fc-9c09-6474b516f680","html_url":"https://github.com/bbc/gel-typography","commit_stats":{"total_commits":197,"total_committers":14,"mean_commits":"14.071428571428571","dds":0.2284263959390863,"last_synced_commit":"9a278a4610e08193641191baa6ca88c2d3961bb5"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fgel-typography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fgel-typography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fgel-typography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fgel-typography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/gel-typography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T00:25:12.272Z","updated_at":"2025-12-29T13:45:42.436Z","avatar_url":"https://github.com/bbc.png","language":"SCSS","readme":"\u003ch1 align=\"center\"\u003eGEL Typography\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    A flexible code implementation of the GEL Typography.\u003cbr /\u003e\n    Forms part of the \u003ca href=\"https://github.com/bbc/gel-foundations\" target=\"_blank\"\u003e\u003cb\u003eGEL Foundations\u003c/b\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Breaking Change: v6.0.0\n\nv6.0.0 of GEL Typography implements the [@use](https://sass-lang.com/documentation/at-rules/use/) and [@forward](https://sass-lang.com/documentation/at-rules/forward/) approach and removes [@import](https://sass-lang.com/documentation/at-rules/import/).\n\nThis has a number of consequences; how modules are loaded, and how to access variables. Namespaces now come into play, so please read the sass documentation links above to learn more.\n\nPreviously, the properties output from this module could be controlled via three variables: $core, $enhanced and $fixed. These three variables allowed for control of the output, where core functionality could be separated out from enhanced functionality (for more advanced browsers) and for Internet Explorer (fixed).\n\nAs browsers have moved on significantly since this approach was adopted it is considered a good time to remove this functionality.\n\nFor usage of GEL Typography prior to v6.0.0 please reference the [v5.2.0 readme](https://github.com/bbc/gel-typography/tree/5.2.0).\n\n\n## What is this?\n\nAn implementation of the [GEL Typography Guidelines](http://www.bbc.co.uk/gel/guidelines/typography).\nProviding typefaces, type sizes, weights, line-heights and tracking.\nThe GEL Typography scale has been established to work on all devices and is independent of device size and resolution.\n\nThe typographic scale has been optimised based on the size of the viewport and the input method being used. We take a 'touch first' approach to typography, adjustments are then made if a primary input other than touch has been detected.\n\nIt can used in two forms, using a Sass mixin:\n\n```scss\n@use 'gel-typography/typography' as type;\n\n.my-component {\n    @include type.gel-typography('canon-bold');\n}\n```\n\nOr by simply adding the relevant classes to your markup:\n\n```html\n\u003ch1 class=\"gel-canon-bold\"\u003eGlobal Experience Language\u003c/h1\u003e\n```\n\n## Installation\n\nThe easiest way to get started with the GEL Typography component is to use the combined version of the typography included within this repository.\n\nIf you're a more advanced user and want to integrate the GEL Typography component within your codebase, use one of the following options:\n\n### Install using NPM\n\n```bash\n$ npm install --save gel-typography\n```\n\n```sass\n// your-app/main.scss\n@use 'gel-typography/typography';\n```\n\n### Install manually\n\nYou 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.\n\n\u003e **Note:** you will manually need to manage the dependencies below, without these this component will fail to compile.\n\n### Loadpaths\n\nBecause this module depends on other modules, [GEL Sass Tools](https://github.com/bbc/gel-sass-tools) and [Sass MQ](https://github.com/sass-mq/sass-mq), when compiling your Sass it needs to know where find the referenced modules. It does this via a [loadPath](https://sass-lang.com/documentation/at-rules/use/#load-paths).\n\nIf compiling from the command line you can specify:\n```\nsass --load-path=node_modules/ \u003coptions\u003e\n```\n\nWith nodejs you can call `compile` or `compileAsync`:\n```js\nawait sass.compileAsync(file, { loadPaths: ['./node_modules'] })\n```\n\nThis ensures the dependencies can be loaded correctly.\n\n\n## Usage\n\nBy default the GEL Typography component does not output any markup but exposes a Sass Mixin which can be called within your Sass.\n\n**Example**\n\n```scss\n@use 'gel-typography/typography' as type;\n\n.my-component {\n    @include type.gel-typography('pica');\n}\n\n.my-component__title {\n    @include type.gel-typography('canon');\n}\n```\n\nA collection of typography classes can be output by defining `$gel-type-enable--markup-output: true;` as you `@use` the typography partial.\n\n**Example:**\n\n```scss\n@use \"gel-typography/typography\" as type with ($gel-type-enable--markup-output: true);\n```\n\nThe following configurable options are available:\n\n### General Configuration\n\n- `$gel-type-namespace: 'gel-';` - the default namespace applied to all typography classes\n- `$gel-type-touch-class: 'no-touch';` - the class exposed used by your touch detection script applied when a non-touch interface is detected\n\n### Output Configuration\n\n- `$gel-type-enable--markup-output: false;` - output a collection of classes for each type group\n- `$gel-type-enable--font-family: false;` - output the correct font-family required by GEL Typography, required if the BBC's global header and footer, Barlesque, is not available.\n- `$gel-type-enable--base-elements: false;` - map the GEL Typography classes to the relevant HTML elements\n\n### Custom Font Configuration\n\nIf you're using another font-face other than Arial and need to make adjustments to any of the type settings you can do this by defining in a custom `$gel-type-settings` map.\n\n*For example:* [BBC News](http://www.bbc.com/burmese) support many languages, some of which do not use latin based character sets which require custom font scripts. It is often the case that these custom fonts will require bespoke font-sizes or line-heights.\n\nFor example, the configuration for Burmese may look like:\n\n```scss\n$gel-type-settings: (\n    'trafalgar': (\n        'group-a': (\n          'font-size': 22px,\n          'line-height': 30px,\n        ),\n        'group-b': (\n          'font-size': 26px,\n          'line-height': 36px\n        ),\n        'group-c': (\n          'font-size': 38px,\n          'line-height': 50px\n        ),\n        'group-d': (\n          'font-size': 32px,\n          'line-height': 32px\n        )\n    ),\n    'trafalgar-bold': (\n       ...\n    )\n);\n```\n\n## Touch Detection\n\nWe operate a [touch-first](http://www.bbc.co.uk/gel/guidelines/how-to-design-for-touch) approach to our Typography. Group C (touch) sizes are used from 600px by default and then detection should be used to get the Group D (non-touch) sizes.\n\nWe also understand that touch detection is not an absolute measure and does not guarantee a 'true or false' outcome - this is okay.\n\n### Why not just have Group C and remove Group D?\n\nProducts such as News \u0026 Sport require more densely packed, legacy-like font sizes for their 'desktop' experience. Eventually we aim to remove this group altogether.\n\n### How can you detect touch\n\nThere are a number of ways you can apply the touch detection. [Modernizr](https://modernizr.com), the common feature detection library offers some basic touch events detection. Alternatively, you could use your own bespoke detection script like this one used by [BBC Sport](https://github.com/bbc/onesport/blob/master/webapp/static-versioned/js/features.js#L5-L24).\n\n## Who is using this?\n\nThe following teams are currently using this component: GEL, News, Sport, Live, Homepage, Search, BBC Food, CBBC, CBeebies, BBC Three, MyBBC, K\u0026L, Taster, Academy, Travel \u0026 Weather, BBC Music, BBC Subtitle Guidelines\n\nIf your team is using this component, let us know and we'll add you to the list.\n\n## Credits\n\n- [Shaun Bent](https://twitter.com/shaunbent)\n- [Al Jones](https://twitter.com/Itsaljones)\n- [Nikos Tsouknidas](https://twitter.com/tsoukn)\n\n## Maintainers\n\n- [Sean Carroll](https://github.com/randombitsUK/)\n\n\n## License\n\n\u003e The MIT License (MIT)\n\u003e\n\u003e Copyright 2016 British Broadcasting Corporation\n\u003e\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy of\n\u003e this software and associated documentation files (the \"Software\"), to deal in\n\u003e the Software without restriction, including without limitation the rights to\n\u003e use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n\u003e the Software, and to permit persons to whom the Software is furnished to do so,\n\u003e subject to the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be included in all\n\u003e copies or substantial portions of the Software.\n\u003e\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\u003e IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n\u003e FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n\u003e COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n\u003e IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n\u003e CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fgel-typography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Fgel-typography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fgel-typography/lists"}