{"id":13716379,"url":"https://github.com/FriendsOfEpub/Blitz","last_synced_at":"2025-05-07T05:32:51.176Z","repository":{"id":176642044,"uuid":"55991337","full_name":"FriendsOfEpub/Blitz","owner":"FriendsOfEpub","description":"An eBook Framework (CSS + template)","archived":true,"fork":false,"pushed_at":"2020-07-02T12:32:40.000Z","size":6553,"stargazers_count":214,"open_issues_count":0,"forks_count":35,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-08-04T00:12:01.931Z","etag":null,"topics":["blitz","css","ebook","ebook-framework","epub","epub2","epub3","framework","kindle"],"latest_commit_sha":null,"homepage":"http://friendsofepub.github.io/Blitz/","language":"CSS","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/FriendsOfEpub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-04-11T17:04:34.000Z","updated_at":"2024-07-18T09:49:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f174c609-67a3-40e0-9988-0284b6f36205","html_url":"https://github.com/FriendsOfEpub/Blitz","commit_stats":null,"previous_names":["friendsofepub/blitz"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfEpub%2FBlitz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfEpub%2FBlitz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfEpub%2FBlitz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfEpub%2FBlitz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendsOfEpub","download_url":"https://codeload.github.com/FriendsOfEpub/Blitz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224567519,"owners_count":17332828,"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":["blitz","css","ebook","ebook-framework","epub","epub2","epub3","framework","kindle"],"created_at":"2024-08-03T00:01:09.883Z","updated_at":"2024-11-14T04:31:27.751Z","avatar_url":"https://github.com/FriendsOfEpub.png","language":"CSS","funding_links":[],"categories":["CSS","framework","Frameworks / Resources","css"],"sub_categories":["B"],"readme":"![Blitz logo](assets/icons/PNG/blitz-2048.png)\n\n# Blitz eBook Framework\n\nAn eBook framework (CSS + template) whose mantra is “finding simple solutions to complex issues.”\n\n## Important Note\n\nAll the Blitz repositories reached End Of Life on July 1, 2020. The entire project is no longer maintained and its repositories are read-only. You can still fork them if they can be useful to you.\n\n## Licence \n\nBlitz is released under [MIT Licence](https://github.com/FriendsOfEpub/Blitz/blob/master/LICENSE) © 2016, Jiminy Panoz.\n\n## Support\n\n- Readium SDK\n- Adobe RMSDK\n- iBooks\n- Kobo\n- Google Play Books\n- Kindle (mobi7 + KF8)\n\n## How to Use\n\nThere are various ways to use blitz, from adding the available stylesheets (`CSS` folder) to building them with the LESS framework.\n\n### Use the Provided Stylesheets\n\nYou can either add `blitz.css` or an alternative stylesheet in your EPUB file.\n\n`blitz.css` is commented but you’ll find an uncommented version in the `AltStylesheets` folder (which helps you save some 7kb).\n\nIn this folder, you’ll also find `blitz-lite.css` and `blitz-reset.css` (normal + minified).\n\n1. `blitz-lite.css` should be enough for simple books like novels and essays (it’s 3kb);\n2. `blitz-reset.css` is just… the reset we’ve designed (it’s 1kb).\n\nAdd styles on top of those two is up to you… But you’ll then miss the powerful tools we’ve built in LESS!\n\n### Install and Compile With npm\n\nFirst go to the blitz root directory and install the dev dependencies: \n\n```\nnpm install\n```\n\nThen make your changes in LESS and run:\n\n```\nnpm run build\n```\n\nThis will compile the LESS src to the default, lite and reset stylesheets, and update the template.\n\nIf you want to compile only one stylesheet you can run:\n\n- `build:default` for the default output (`blitz.css`) – that will update the template’s unzipped src too;\n- `build:lite` for the lite output (`blitz-lite.css`);\n- `build:reset` for the reset output (`blitz-reset.css`);\n\nAll those sub-builds will generate uncommented/minified files as well.\n\nFinally, to update the packaged EPUB file then use `npm run make`.\n\n### Compile LESS Sources Without npm\n\nEither use the [GUI](http://lesscss.org/usage/#guis-for-less) or, if you’re one of the old-school type…\n\n#### For Default\n\n```\nlessc Blitz_framework/LESS/blitz.less Blitz_framework/CSS/blitz.css\n```\n\n#### For Lite\n\n```\nlessc Blitz_framework/LESS/blitz-lite.less Blitz_framework/CSS/AltStylesheets/blitz-lite/blitz-lite.css\n```\n\n#### For Reset\n\n```\nlessc Blitz_framework/LESS/blitz-reset.less Blitz_framework/CSS/AltStylesheets/blitz-reset/blitz-reset.css\n```\n\n## Related Blitz Tools\n\n- [Blitz Tasks](https://github.com/FriendsOfEpub/blitz-tasks) – a set of gulp scripts to automate (X)HTML markup changes and apply some useful optimizations\n- [blitzck-cli](https://github.com/FriendsOfEpub/blitzck-cli) – EPUB Reading Systems’ support, mimetypes, namespaces, and ARIA mappings from the command line interface\n- [Blitz Checklist](https://github.com/FriendsOfEpub/blitz-checklist) – A template repository to make checklist web apps (it’s the tiny little engine that powers the BlitzOptim and BlitzPerf web apps)\n- [The eBook Design Checklist](https://friendsofepub.github.io/eBookDesignChecklist/) – a progressive web app to help you design eBooks\n- [The eBook Performance Checklist](https://friendsofepub.github.io/eBookPerfChecklist/) – a progressive web app to help you boost eBook performance\n- [Blitz eBook Tricks](https://friendsofepub.github.io/eBookTricks/) – a collection of CSS snippets to help you do progressive enhancement in eBooks\n\n## Design \u0026 Goals\n\nBlitz was designed to deal with the significant obstacles a newcomer or even an experienced producer might encounter. Its major goals are:\n\n1. to be simple and robust enough;\n2. to offer a sensible default;\n3. to manage backwards compatibility (ePub 2.0.1 + mobi 7);\n4. to provide useful tools (LESS);\n5. to get around reading modes (night, sepia, etc.);\n6. to **not** disable user settings.\n\nWe have chosen a functional approach (FCSS) but LESS presets are planned to provide meaningful class names depending on eBook’s type (poetry, plays, etc.).\n\n### The 4 Principles of Blitz\n\n1. **Espouse [inheritance and the cascade](https://www.w3.org/wiki/Inheritance_and_cascade)**, the 2 fundamental principles of CSS. eBooks are documents, CSS was designed for documents… It’s a match! \n2. **Build and refine**, don’t style and undo. Don’t override your own styles, create reusable components—the reset should help you do that.\n3. **Don’t fight, skirt.** Be smart, it’s not worth fighting RS’ default stylesheets (their selectors and !importants are too much hassle), *trompe le monde.*\n4. **Have fun!** We’ve done our utmost to help you avoid common pitfalls. You don’t have to deal with the crappiest parts of eBook CSS authoring, sit back and relax.\n\n### Useful Details\n\nBlitz is leveraging the concept of inheritance. Values `inherit` and `currentColor` are being used extensively to make the framework compatible with Reading Systems’ default stylesheets, reading modes (`color`) and user settings (`font-size`, `font-family`, `line-height`, etc.).\n\nDefaults and a reset do the heavy lifting so it’s just about building on top of this base. Please note Blitz is taking care of defaults RS aren’t necessarily (HTML5 block elements, hyphens and pagebreaks for selected elements, etc.).\n\nFinally, although we try to rely on RS’ typefaces, typography has been fine tuned.\n\n- The default scale has been chosen to handle various situations well enough (screen/container size, user increasing `font-size`, typeface used, etc.)\n- Vertical rhythm (`line-height` + `margin` and `padding`) is automatically computed in LESS to enforce consistency. By taking care of vertical rhythm, we’re also achieving horizontal harmony when the eBook is rendered on a (fake) spread: “everything text” lines up on the same baseline grid, which makes for a more comfortable reading experience.\n- `sup` and `sub` styling is improved to prevent them from affecting line-height.\n- The whole [§8. Breaking Within Words](https://drafts.csswg.org/css-text-4/) is implemented in LESS.\n\nTo sum up, we’ve tried to find a balance and feel like Blitz defaults can help producers get around a lot of possible issues: we don’t need hacks, we don’t have to change values in specific situations using complex media queries.\n\n### Related EPUB 3.1 issues\n\n- The EPUB 3.1 spec should address common reader styling scenarios [#671](https://github.com/IDPF/epub-revision/issues/671)\n- Defining a minimal default stylesheet in the epub spec [#672](https://github.com/IDPF/epub-revision/issues/672)\n- Media Queries [#685](https://github.com/IDPF/epub-revision/issues/685)\n- Possible spec language for reading system CSS handling [#693](https://github.com/IDPF/epub-revision/issues/693)\n\n### Browserlist we’re using for progressive enhancements\n\nThe following is a list of browsers/rendering engines modern EPUB apps are using behind the scenes. It is using the [browserlist format](https://github.com/browserslist/browserslist) and can be imported in websites such as [CanIUse](https://caniuse.com/#browserset_select).\n\n```\nie \u003e= 11\nedge \u003e= 14\nlast 4 chrome major versions\nsafari \u003e= 9.1\nios_saf \u003e= 9.3\nandroid \u003e= 4.4\nlast 2 and_chr major versions\n```\n\nAlternatively, you can use [this CanIuse Link](https://caniuse.com/?browserset=ie%20%3E%3D%2011%2Cedge%20%3E%3D%2014%2Clast%204%20chrome%20major%20versions%2Csafari%20%3E%3D%209.1%2Cios_saf%20%3E%3D%209.3%2Candroid%20%3E%3D%204.4%2Clast%202%20and_chr%20major%20versions).\n\nWhen checking for support, you can simply click “Apply Filters” in order to display those browsers in the support table.\n\n#### Some more details\n\n- IE 11’s Trident is used by some Windows app like Adobe Digital Editions 4.5\n- Edge is aligned with the release of the eBook Reader in the Edge browser\n- Safari on MacOS is aligned with the release of iBooks on Mavericks (10.9)\n- Safari on iOS is starting at iOS 9.3\n- Android 4.4.4 is still used by some apps on Android while others are using the more modern WebView (2 last Android versions)\n\n## Frequently Addressed Questions\n\n### Is this project still active?\n\nNope.\n\nBlitz was sunset in 2020. As of July 1, 2020 the entire project is no longer maintained and its repositories read-only. You can still fork them.\n\nWe deemed Blitz feature-complete though, and it should consequently be still useful for a couple of years.\n\n### Has anyone funded this project?\n\nNope. \n\nIt grew organically out of the desire to learn CSS preprocessors, then improve at JavaScript and make Progressive Web Apps, etc. It just seemed that side projects sharing knowledge that would be useful to the ebook production community was the best way to achieve those goals.\n\nAt some point, sponsoring was considered but quickly dismissed due to the relatively small size of the ebook production community: it was simply too much to ask.\n\n### Which features did not make it into the framework?\n\nQuite a lot, actually.\n\n- Building an online CSS generator in the form of a website where people would answer questions, and a stylesheet would be created based on those answers.\n- Presets for different genres of books.\n- Poor man’s Dev Tools.\n- A JavaScript library of interactive widgets.\n- Automated scripts to update ePub2 files to EPUB3, convert `epub:type` to DPUB ARIA, clean DTP outputs’ markup, etc. (would have required GUI since everyone is not comfortable with the command-line and npm).\n- A CanIUse-like service.\n- etc.\n\nBut maybe *you* could successfully build a business out of that list…\n\n### What is missing in version 1?\n\nBetter internationalization.\n\nBy improving support for the 24 additonal languages we added at some point, Blitz would better cover the needs and requirements of 3,049,150,507 speakers.\n\n### Why was JS abandoned?\n\nJavaScript has quite a bad reputation in publishing, especially as Kindle and eReaders relying on Adobe’s RMSDK don’t support it. So it was not worth pursuing JavaScript exploration despite [all the Research and Development that had gone into it](https://jaypanoz.github.io/ebookcraft2017).\n\nA library of custom elements almost happened after successful initial testing, but one careful review later, it was clear most authors wouldn’t even bother trying such a library. That wasn’t a hill to die on when most authors want Reading Systems to handle that out of the box.\n\n### How to leverage the LESS meta-language?\n\n[Check this tutorial](https://friendsofepub.github.io/Blitz/documentation/tutorial.html).\n\n## Log\n\n### 1.5.2\n\n- Guarded header comment so that it’s output in all stylesheets (to make it a little bit easier for [DAISY WordToEPUB](https://daisy.org/activities/software/wordtoepub/))\n\n### 1.5.1\n\n- Created a `.line-through` static mixin in utilities\n- Improved consistency of mixin usage in LESS\n\n### 1.5.0\n\nWith massive props to [@ptmkenny](https://github.com/ptmkenny) for internationalization and config improvements.\n\n- Improved and completed `text-emphasis` for Japanese\n- Implemented ruby text in default for Japanese\n- Implemented `min-light-height` as a variable (for Kindle)\n- Implemented a font-family variable for a custom headings selector\n- Fixed list style type for Kindle\n- Made asterism path a global variable\n- Made link color a separate variable\n- Made font stacks global variables so that they can be reused in the codebase\n- Made Kindle output a flag users can enable/disable (`@handle-kindle`)\n\n### 1.4.1\n\n- Fixed `padding-left` for lists (switched to relative `ems`) so that markers can’t be cropped\n\n### 1.4.0\n\n- Added internationalization reference to the LESS framework\n\n### 1.3.0\n\n- Moved Kindle Media Queries and styles into core\n- Removed other MQs\n\n### 1.2.4\n\n- Corrected tables’ cell padding (switched back to `px` value instead of `%` as it depended on RSs’ forcing a relayout)\n- Disabled a11y metadata in an attempt to provide a reasonable default\n\n### 1.2.3\n\n- Corrected KF8’s bug where `page-break-inside: avoid` can create a blank\n\n### 1.2.2\n\n- Corrected Mobi7 font size for `.small-caps`\n\n### 1.2.1\n\n- Corrected `.small-caps` and created a new `.caps-to-small-caps` util\n\n### 1.2.0\n\n- Progressive enhancements plugin is now implemented at the core of the LESS framework:\n    - removed support for [font-variant-alternates](https://www.w3.org/TR/css-fonts-4/#font-variant-alternates-prop);\n    - removed [font-feature-settings](https://www.w3.org/TR/css-fonts-4/#font-rend-desc) properties;\n    - corrected negative (`not`) feature queries\n- Automated build with npm\n\n### 1.1.3\n\n- Removed gap after images\n- Added DPUB ARIA roles in template\n\n### 1.1.2\n\n- Fixed hyphenation (limit chars)\n\n### 1.1.1\n\n- added reset styles for `hidden` attribute to improve backwards compatibility;\n- added a utility for `list-style-type: none`;\n- an experimental plugin for progressive enhancements is now available ([check docs](https://github.com/FriendsOfEpub/Blitz/blob/master/Blitz_framework/LESS/plugins/blitz_progressive-docs.md)). \n\n### 1.1.0\n\n- Added plugin for progressive enhancements.\n\n### 1.0.1\n\n- improved `hr.transition` (won’t screw up vertical rhythm because margins any longer);\n- `-webkit-locale` now an override (issue #9).\n\n### 0.9.5 (Pre-release) -\u003e 1.0.0 (stable)\n\n- refacto making the framework much easier to handle and customize (typo is now barebones)\n- asterism is now an SVG background (beware! it’s an external dependency)\n- CSS has been fine-tuned (e.g. `limit-lines`, tabular numerals, `object-fit`, etc.)\n- added mixins to override and customize `list-style-type`\n- prevented blank page at the end of xhtml in reset\n- initialized docs (vanilla docs + API flavored reference)\n- containers’ and images’ classes in `vh` are now available\n- corrected epub namespace\n- completed utilities (margins, underline, etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFriendsOfEpub%2FBlitz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFriendsOfEpub%2FBlitz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFriendsOfEpub%2FBlitz/lists"}