{"id":4524,"url":"https://github.com/brentvatne/react-native-debug-stylesheet","last_synced_at":"2025-04-13T21:36:45.061Z","repository":{"id":30196494,"uuid":"33747330","full_name":"brentvatne/react-native-debug-stylesheet","owner":"brentvatne","description":"Stylesheet that helps you debug layout problems in react-native, because we're all still not that good at flexbox","archived":false,"fork":false,"pushed_at":"2016-04-05T19:20:15.000Z","size":82,"stargazers_count":89,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T11:51:22.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-debug-stylesheet","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brentvatne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-10T19:42:36.000Z","updated_at":"2022-05-02T09:41:34.000Z","dependencies_parsed_at":"2022-09-03T07:11:33.052Z","dependency_job_id":null,"html_url":"https://github.com/brentvatne/react-native-debug-stylesheet","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentvatne%2Freact-native-debug-stylesheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentvatne%2Freact-native-debug-stylesheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentvatne%2Freact-native-debug-stylesheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentvatne%2Freact-native-debug-stylesheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brentvatne","download_url":"https://codeload.github.com/brentvatne/react-native-debug-stylesheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788621,"owners_count":21161725,"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-01-05T20:17:15.209Z","updated_at":"2025-04-13T21:36:45.020Z","avatar_url":"https://github.com/brentvatne.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["Build \u0026 Development"],"readme":"## react-native-debug-stylesheet\n\nWhen you want to debug layout problems, use this instead of the normal\n`StyleSheet` to get coloured borders (or backgrounds) around views that\nare affected by the stylesheet.\n\n![Demo](https://raw.githubusercontent.com/brentvatne/react-native-debug-stylesheet/master/demo.png)\n\n## Add it to your project\n\n\n1. Run `npm install react-native-debug-stylesheet --save`\n2. When you want to debug a layout problem, do something like this:\n\n```javascript\nvar { PixelRatio, StyleSheet } = require('react-native');\n// Drop this in to override the above StyleSheet var and use the\n// DebugStyleSheet class instead.\nvar StyleSheet = require('react-native-debug-stylesheet');\n\n// Business as usual\nStyleSheet.create({\n  // ....\n});\n```\n\nIf you prefer to use coloured backgrounds, then do this:\n\n```javascript\nvar StyleSheet = require('react-native-debug-stylesheet').Backgrounds;\n```\n\n### Customize\n\nIf you'd rather make your own debug stylesheet than use the default\nborder/background color options, you can do this easily too.\n\n```javascript\nvar { createDebugStylesheet, randomHexColor } = require('react-native-debug-stylesheet');\n\nvar doubleHeaderFontSize = function(styleClass, cssProperty, cssValue) {\n  if (cssValue \u0026\u0026 styleClass.match(/header/)) {\n    return cssValue * 2;\n  }\n  return cssValue;\n}\n\nvar StyleSheet = createDebugStylesheet({\n  backgroundColor: randomHexColor, fontSize: doubleHeaderFontSize,\n  borderColor: randomHexColor, borderWidth: 0.5,\n});\n```\n\n---\n\n**MIT Licensed**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentvatne%2Freact-native-debug-stylesheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrentvatne%2Freact-native-debug-stylesheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentvatne%2Freact-native-debug-stylesheet/lists"}