{"id":13508008,"url":"https://github.com/ethantw/Han","last_synced_at":"2025-03-30T09:33:22.437Z","repository":{"id":42233100,"uuid":"1450993","full_name":"ethantw/Han","owner":"ethantw","description":"「漢字標準格式」印刷品般的漢字排版框架 Han.css: the CSS typography framework optimised for Hanzi.","archived":false,"fork":false,"pushed_at":"2024-02-13T15:15:05.000Z","size":4168,"stargazers_count":2401,"open_issues_count":15,"forks_count":135,"subscribers_count":79,"default_branch":"master","last_synced_at":"2024-10-29T15:41:26.147Z","etag":null,"topics":["css","han","sass","stylus","typography"],"latest_commit_sha":null,"homepage":"https://hanzi.pro/","language":"JavaScript","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/ethantw.png","metadata":{"files":{"readme":"README-en.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}},"created_at":"2011-03-07T17:10:42.000Z","updated_at":"2024-10-29T08:58:25.000Z","dependencies_parsed_at":"2024-06-02T12:02:58.336Z","dependency_job_id":"597f7967-4f1a-4561-8470-a66354054a94","html_url":"https://github.com/ethantw/Han","commit_stats":{"total_commits":859,"total_committers":9,"mean_commits":95.44444444444444,"dds":0.08381839348079156,"last_synced_commit":"0fb787600379945f54b52a43206ffd49d14aa9e5"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethantw%2FHan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethantw%2FHan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethantw%2FHan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethantw%2FHan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethantw","download_url":"https://codeload.github.com/ethantw/Han/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246223309,"owners_count":20743163,"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":["css","han","sass","stylus","typography"],"created_at":"2024-08-01T02:00:45.370Z","updated_at":"2025-03-30T09:33:22.401Z","avatar_url":"https://github.com/ethantw.png","language":"JavaScript","readme":"\n- [中文](https://github.com/ethantw/Han/blob/master/README.md)\n- [日本語](https://github.com/ethantw/Han/blob/master/README-ja.md)\n- \u003cb\u003eEnglish\u003c/b\u003e\n\n\nHan.css\n=======\n\nHan.css is a Sass/Stylus and JavaScript typesetting framework featuring style normalisation to semantic elements, typography and advanced typesetting. Its elegant, standardised Hanzi (CJK) environment provides not only the legacy of reading convention but also the de facto specification in the digital. Han.css is the solution to Hanzi web design for the time being.\n\nHan.css supports Traditional Chinese, Simplified Chinese and Japanese.\n\n[View the test pages (zh)](http://ethantw.github.io/Han/latest/)\n\n## Installation\n- NPM `npm install --save han-css`\n- Bower `bower install --save Han`\n- Rails `gem install 'hanzi-rails'` ([Check out the details here](https://github.com/billy3321/hanzi-rails))\n\n### Customisation\nHan.css provides plenty of customisable features. By variable configuration or module import, it is easy to compile projects own style sheets. [Check out the manual (zh)][api] for detailed information.\n\n[api]: http://css.hanzi.co/manual/sass-api\n\n### Use of CDN\nFor high-speed downloads and cache, in need of customisation otherwise, you can use the CDN style sheets, JavaScript files and web fonts compiled by default configuration. The service [is hosted on cdnjs.com][cdnjs].\n\n[cdnjs]: http://cdnjs.com/libraries/han\n\n````html\n\u003clink rel=\"stylesheet\" media=\"all\" href=\"//cdnjs.cloudflare.com/ajax/libs/Han/3.3.0/han.min.css\"\u003e\n````\n\nJavaScript,\n\n````html\n\u003cscript src=\"//cdnjs.cloudflare.com/ajax/libs/Han/3.3.0/han.min.js\"\u003e\u003c/script\u003e\n````\n\nWeb fonts,\n\n- WOFF `//cdnjs.cloudflare.com/ajax/libs/Han/3.3.0/font/han.woff`\n- OTF `//cdnjs.cloudflare.com/ajax/libs/Han/3.3.0/font/han.otf`\n\n## How to use\n\n1. Include `han.min.css` before all other styles (or import it via Sass/Stylus).\n2. Include the script file, `han.min.js`, according to own requirements. Then add the class name `han-init` onto `\u003chtml\u003e` tag to activate DOM-ready rendering.\n3. Or, customise your own rendering routine. [Check out the manual][rendering] for further information.\n\n[rendering]: http://css.hanzi.co/manual/js-api#rendering\n\n### JavaScript is optional\nHan.css is of low coupling and high semantics. Style sheets and JavaScript depend *little* on each other. Multi-level fallback can be applied within the style sheets, hence the optional use of the scripts.\n\n## FAQ\n### Issue of overwriting styles\nDifferent from most of the CSS frameworks, Han.css contains numerous style correction aiming at the language attribute `:lang`. It may cause unexpected results such as style overwritting not carried out.\n\n#### Element types with language-based style correction:\n- \u003ci\u003eText-level semantics\u003c/i\u003e\n- \u003ci\u003eGrouping content\u003c/i\u003e and combining situations with \u003ci\u003esections\u003c/i\u003e **(font-family only)**\n- The \u003ci\u003eroot\u003c/i\u003e element `html` **(font-family only)**\n\n#### Solution\nIn order to handle these circumstances properly, please be well-alarmed with rules of style inheritance. It is recommended to add the corresponding language attribute, parental elements or other selectors, rather to overuse the `!important` declaration for maintainability.\n\nUse the ‘DOM Inspector’ in browsers to observe the inheritance and overwritten relations of style sheets while in need.\n\n### Working environments\nHan.js runs in DOM environments only. Introduce modules such as [jsdom] for server-side usage.\n\n[jsdom]: https://github.com/tmpvar/jsdom\n\n## Browser support\n\n- Chrome (latest)\n- Edge (latest)\n- Firefox (latest)\n- Firefox ESR+\n- Internet Explorer 11\n- Opera (latest)\n- Safari 9\n\n## Requirements and developing commands\n\n- Node.js\n- LiveScript 1.4.0 (`sudo npm install -g livescript`)\n\nBelow goes the list with some useful developing commands:\n\n- Install dev-dependencies: `sudo npm install`\n- Start the dev-environment: `npm start` or `gulp dev` (including local server running and auto compiling)\n- Compile the distribution files: `gulp build`\n- Test `han.js`‘s API: `gulp test` (PhantomJS)\n- Update dependencies: `sudo npm update \u0026\u0026 gulp dep`\n\n* * *\nHan.css v3.3.0  \nLast-modified: 2016-3-19 00:11 (UTC+8)\n\n","funding_links":[],"categories":["JavaScript","CSS","字体插件"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethantw%2FHan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethantw%2FHan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethantw%2FHan/lists"}