{"id":17800929,"url":"https://github.com/refi64/scopify","last_synced_at":"2026-01-11T04:52:40.181Z","repository":{"id":56838618,"uuid":"104940578","full_name":"refi64/scopify","owner":"refi64","description":"A Dart library for compiling scoped styles","archived":false,"fork":false,"pushed_at":"2018-09-10T21:19:09.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T01:41:27.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/scopify","language":"Dart","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/refi64.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-09-26T21:40:33.000Z","updated_at":"2022-03-09T02:43:03.000Z","dependencies_parsed_at":"2022-09-13T04:50:18.817Z","dependency_job_id":null,"html_url":"https://github.com/refi64/scopify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fscopify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fscopify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fscopify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fscopify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refi64","download_url":"https://codeload.github.com/refi64/scopify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858658,"owners_count":20359392,"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-10-27T12:32:37.390Z","updated_at":"2026-01-11T04:52:40.150Z","avatar_url":"https://github.com/refi64.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scopify\n\n**scopify** implements scoped styling in a manner similar to HTML5 and Vue. It processes\nthe given HTML nodes and CSS stylesheets in-place, adding specialized attributes that\nmake sure the CSS can only ever modify the given HTML.\n\n## Example\n\n```dart\nimport 'package:csslib/parser.dart' as css;\nimport 'package:csslib/visitor.dart' show CssPrinter;\nimport 'package:html/parser.dart' as html;\n\nimport 'package:scopify/scopify.dart';\n\n\nvoid main() {\n  var myCss = 'p#my-id { color: purple; }';\n  var myHtml = '\u003cp id=\"my-id\"\u003epurplified text here\u003c/p\u003e';\n\n  // First, we have to parse the CSS and HTMl text.\n  var style = css.parse(myCss);\n  var node = html.parse(myHtml);\n\n  // Now, we can call scopify. It takes two arguments: a list of HTML nodes, and a list of CSS\n  // stylesheets to process.\n  scopify(html: [node], css: [style]);\n\n  // The HTML and CSS parse trees were modified in-place. Now, the CSS will only ever modify this\n  // HTML code, even when combined with other HTML code.\n\n  // To get the resulting HTML:\n  var resultHtml = node.outerHtml;\n  print(resultHtml);\n\n  // and CSS:\n  var printer = new CssPrinter();\n  style.visit(printer);\n  var resultCss = printer.toString();\n  print(resultCss);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fscopify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefi64%2Fscopify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fscopify/lists"}