{"id":15487773,"url":"https://github.com/werediver/stylesheet","last_synced_at":"2025-06-21T17:06:26.174Z","repository":{"id":69241719,"uuid":"71472382","full_name":"werediver/StyleSheet","owner":"werediver","description":"Reusable and composable UI styles","archived":false,"fork":false,"pushed_at":"2018-09-29T12:12:18.000Z","size":258,"stargazers_count":23,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-05T02:34:16.070Z","etag":null,"topics":["ios","macos","stylesheet","swift","uiappearance","uikit"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/werediver.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-20T14:39:19.000Z","updated_at":"2019-12-22T12:32:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8a7a0c6-4096-49fb-91cc-cc638e36c78b","html_url":"https://github.com/werediver/StyleSheet","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/werediver/StyleSheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werediver%2FStyleSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werediver%2FStyleSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werediver%2FStyleSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werediver%2FStyleSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/werediver","download_url":"https://codeload.github.com/werediver/StyleSheet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werediver%2FStyleSheet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261162065,"owners_count":23118221,"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":["ios","macos","stylesheet","swift","uiappearance","uikit"],"created_at":"2024-10-02T06:41:41.618Z","updated_at":"2025-06-21T17:06:21.150Z","avatar_url":"https://github.com/werediver.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Swift 4.2](https://img.shields.io/badge/Swift-4.2-blue.svg)](https://swift.org/)\n![Platforms: iOS, macOS](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS-blue.svg)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)\n[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org/)\n\n# StyleSheet\n\nAn approach to define reusable and composable UI styles.\n\nHaving some base styles defined you can use them like so:\n\n```swift\nfinal class TitleLabel: UILabel, TitleFontStyle {}\nfinal class BodyLabel: UILabel, BodyFontStyle, MultilineLabelStyle {}\nfinal class CaptionLabel: UILabel, CaptionFontStyle, MultilineLabelStyle {}\n```\n\n![Example screenshot](Images/example-composed.png)\n\nFor a complete usage example see the [Example](Example/) project.\n\nFor the implementation details see [`Style.swift`](Sources/Style.swift) and [`RootStyle.swift`](Sources/RootStyle.swift).\n\n## Motivation\n\n### Why to define the UI style in code?\n\nDefining the UI style in code is good because it gives\n\n- _reproducible_,\n- _reusable_,\n- and _composable_ results.\n\n### Why not to use UIAppearance?\n\nBecause we can do better. By avoiding the use of the appearance-proxy we can access _all_ properties and methods (not only `UI_APPEARANCE_SELECTOR` and `dynamic`), and nested objects!\n\n## Supported base classes\n\n| Base class               | UIAppearance | StyleSheet | Notes               |\n|--------------------------|--------------|------------|---------------------|\n| NSView                   |              | ✓          |                     |\n| UIView                   | ✓            | ✓          |                     |\n| UIBarItem                | ✓            | ✗          | See the issue [#1](https://github.com/werediver/StyleSheet/issues/1) |\n\n## Installation\n\n### Carthage\n\n```\ngithub \"werediver/StyleSheet\" ~\u003e 5.0\n```\n\n### CacoaPods\n\n```ruby\npod 'StyleSheet', :git =\u003e 'https://github.com/werediver/StyleSheet.git', :tag =\u003e 'v5.0.0'\n```\n\nNote: check the latest available version!\n\n## License\n\n[MIT](https://github.com/werediver/StyleSheet/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwerediver%2Fstylesheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwerediver%2Fstylesheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwerediver%2Fstylesheet/lists"}