{"id":13767368,"url":"https://github.com/Solant/nodegui-stylesheet","last_synced_at":"2025-05-10T22:31:47.775Z","repository":{"id":42932103,"uuid":"239006476","full_name":"Solant/nodegui-stylesheet","owner":"Solant","description":"react-native stylesheets implementation for nodegui and react-nodegui","archived":false,"fork":false,"pushed_at":"2023-01-07T04:31:52.000Z","size":398,"stargazers_count":11,"open_issues_count":7,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-18T23:19:58.776Z","etag":null,"topics":["css","no","nodegui","react-nodegui","stylesheet","stylesheets"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Solant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-07T19:24:14.000Z","updated_at":"2024-01-03T12:15:04.000Z","dependencies_parsed_at":"2023-02-06T11:46:24.989Z","dependency_job_id":null,"html_url":"https://github.com/Solant/nodegui-stylesheet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solant%2Fnodegui-stylesheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solant%2Fnodegui-stylesheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solant%2Fnodegui-stylesheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solant%2Fnodegui-stylesheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Solant","download_url":"https://codeload.github.com/Solant/nodegui-stylesheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"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","no","nodegui","react-nodegui","stylesheet","stylesheets"],"created_at":"2024-08-03T16:01:07.950Z","updated_at":"2025-05-10T22:31:45.445Z","avatar_url":"https://github.com/Solant.png","language":"TypeScript","readme":"# nodegui-stylesheet\n![Codecov](https://img.shields.io/codecov/c/github/Solant/nodegui-stylesheet?style=flat-square)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Solant/nodegui-stylesheet/Build?style=flat-square)\n![David](https://img.shields.io/david/Solant/nodegui-stylesheet?style=flat-square)\n![npm bundle size](https://img.shields.io/bundlephobia/min/nodegui-stylesheet?style=flat-square)\n\n`react-native` inspired implementation of [stylesheet](https://facebook.github.io/react-native/docs/stylesheet), written in typescript\n\nCompatible with plain `nodegui` and `react-nodegui`, both JS and TS.\n\n# Why \nDespite web nature of css styling of Qt widgets, sometimes it can fall flat due to some strange inconsistencies and differences between Qt and web browser \nHere is a list of inconsistencies that gets handled: \n1. font-size value requires unit and must be without quotes\n2. some string keywords should not be wrapped in quotes\n3. [lineedit-password-character-prop](https://doc.qt.io/qt-5/stylesheet-reference.html#lineedit-password-character-prop) can accept both unicode number and string (string will be converted to unicode number)\n\n# Example\n\n1 Create a stylesheet\n\n```javascript\nimport { create } from 'nodegui-stylesheet';\n\nconst style = create({\n  wrapper: {\n    flex: 1\n  },\n  logo: {\n    fontSize: 14\n  }\n});\n```\n\n2 Use stylesheet properties instead of long css strings\n```typescript jsx\n// with nogegui-react\n\u003cView style={style.wrapper}\u003e\n  \u003cText style={style.logo}\u003eHello\u003c/Text\u003e\n\u003c/Text\u003e\n```\n\n```javascript\n// with plain nogegui\nconst label = new QLabel();\nlabel.setText(\"Hello\");\nlabel.setInlineStyle(style.logo);\n```\n\n3 Use specific units if you need them, [list of supported units from qt docs](https://doc.qt.io/qt-5/stylesheet-reference.html#length):\n\n- px: pixels\n- pt: the size of one point (i.e., 1/72 of an inch)\n- em: the em width of the font (i.e., the width of 'M')\n- ex: the ex width of the font (i.e., the height of 'x')\n\n```javascript\nimport { create, units } from 'nodegui-stylesheet';\n\nconst style = create({\n  wrapper: {\n    flex: 1\n  },\n  logo: {\n    marginTop: units(1, 'ex')\n  }\n});\n```\n","funding_links":[],"categories":["Tools"],"sub_categories":["Samples and Experiments"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSolant%2Fnodegui-stylesheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSolant%2Fnodegui-stylesheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSolant%2Fnodegui-stylesheet/lists"}