Title: An improvement to help "ViewBox" a BonsaiBim Drawing Manager & CSS Editor · Issue #7312 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: An improvement to help "ViewBox" a BonsaiBim Drawing Manager & CSS Editor · Issue #7312 · IfcOpenShell/IfcOpenShell
X Title: An improvement to help "ViewBox" a BonsaiBim Drawing Manager & CSS Editor · Issue #7312 · IfcOpenShell/IfcOpenShell
Description: Feature Description Is an Improvement in sheeter.py for ensure unique styles bim/module/drawing/sheeter.py. ViewBox work with pure CSS and this help to treat pattern transformations and styling in the CSS block correctly and not as css r...
Open Graph Description: Feature Description Is an Improvement in sheeter.py for ensure unique styles bim/module/drawing/sheeter.py. ViewBox work with pure CSS and this help to treat pattern transformations and styling in ...
X Description: Feature Description Is an Improvement in sheeter.py for ensure unique styles bim/module/drawing/sheeter.py. ViewBox work with pure CSS and this help to treat pattern transformations and styling in ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/7312
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"An improvement to help \"ViewBox\" a BonsaiBim Drawing Manager & CSS Editor","articleBody":"### Feature Description\n\nIs an Improvement in sheeter.py for ensure unique styles bim/module/drawing/sheeter.py. ViewBox work with pure CSS and this help to treat pattern transformations and styling in the CSS block correctly and not as css rule.\n\ndef ensure_drawing_unique_styles(self, svg: ET.Element, drawing_id: int) -> ET.Element:\n \"\"\"ensures all drawing's classes and ids will be unique for the whole sheet\n by adding `drawing_id` based prefix\n \"\"\"\n prefix = f\"d{drawing_id}\" # just number doesn't work\n\n # add .prefix class to all css selectors\n style = svg.find(f\"{SVG}defs/{SVG}style\")\n assert style is not None\n style_data = style.text\n assert style_data is not None\n text = \"\"\n brackets_level = 0\n for l in style_data:\n if l == \"{\":\n if brackets_level == 0:\n cur_line = text.splitlines()[-1]\n text = text[: -len(cur_line)]\n css_selectors = []\n for css_selector in cur_line.split(\",\"):\n selector = css_selector.strip()\n if selector.startswith(\"#\"):\n new_selector = f\"#{prefix}-{selector[1:]}\"\n else:\n new_selector = f\"{selector}.{prefix}\"\n css_selectors.append(new_selector)\n text += \", \".join(css_selectors) + \" \"\n brackets_level += 1\n elif l == \"}\":\n brackets_level -= 1\n text += l\nThanks\nhttps://github.com/sl-x75/ViewBox\nhttps://community.osarch.org/discussion/3199/a-drawing-manager-and-css-editor-for-bonsaibim#latest","author":{"url":"https://github.com/sl-x75","@type":"Person","name":"sl-x75"},"datePublished":"2025-11-03T00:46:47Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/7312"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:25a748ac-c1ad-91af-efd9-2d51195209f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB12:12E21E:4756E:63026:6B04AE44 |
| html-safe-nonce | 246f8b2e1fe808c25f58f81c898bea1f303db9cecf855cf2ae8c29194b0e91b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjEyOjEyRTIxRTo0NzU2RTo2MzAyNjo2QjA0QUU0NCIsInZpc2l0b3JfaWQiOiI3OTA4NjMyNjk3NjU5MjQwMDA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 832752bc6732cecc8a09d23708a3ea072096c867dfb56599147a6fc2c3ea874e |
| hovercard-subject-tag | issue:3580203859 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/7312/issue_layout |
| twitter:image | https://opengraph.githubassets.com/23a15506d50f79bea69a1baab028232494e17ffe8389436e165cccec0b6508f7/IfcOpenShell/IfcOpenShell/issues/7312 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/23a15506d50f79bea69a1baab028232494e17ffe8389436e165cccec0b6508f7/IfcOpenShell/IfcOpenShell/issues/7312 |
| og:image:alt | Feature Description Is an Improvement in sheeter.py for ensure unique styles bim/module/drawing/sheeter.py. ViewBox work with pure CSS and this help to treat pattern transformations and styling in ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sl-x75 |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width