Title: CSS selectors don't support escape sequence · Issue #7688 · NativeScript/NativeScript · GitHub
Open Graph Title: CSS selectors don't support escape sequence · Issue #7688 · NativeScript/NativeScript
X Title: CSS selectors don't support escape sequence · Issue #7688 · NativeScript/NativeScript
Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.0.3 Cross-platform modules: 6.0.6 Android...
Open Graph Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.0...
X Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.0...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/7688
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CSS selectors don't support escape sequence","articleBody":"**Environment**\r\n\r\nProvide version numbers for the following components (information can be retrieved by running `tns info` in your project folder or by inspecting the `package.json` of the project):\r\n - CLI: 6.0.3\r\n - Cross-platform modules: 6.0.6\r\n - Android Runtime: 6.0.1\r\n - iOS Runtime: 6.0.2\r\n - Plugin(s): [nativescript-tailwind](https://github.com/rigor789/nativescript-tailwind), ... (N/A)\r\n\r\n**Describe the bug**\r\n\r\nGiven we have a css selector like this:\r\n```css\r\n.w-1\\/2 {\r\n width: 50%;\r\n}\r\n```\r\nThis is fully supported in browsers, however in NativeScript when the css parser parses it, the selector is parsed as `.w-1` completely ignoring the `\\/2` part. \r\n\r\nIn practice you would use these selectors as `\u003cElement class=\"w-1/2\" /\u003e`.\r\n\r\nThe issue with them parsing as just `.w-1` is that if you already have a `.w-1` class, it will override it's properties and lead to undesired results.\r\n\u003c!-- A clear and concise description of what the bug is. Please, explain whether it's a build time error or a runtime error. More detailed logs can be easily obtained by following the instructions in this guide: https://docs.nativescript.org/get-support#how-to-obtain-diagnostic-reports. --\u003e\r\n\r\n**To Reproduce**\r\n\r\nAdd the following css to any NativeScript app\r\n```css\r\n.w-1 {\r\n width: 25;\r\n}\r\n.w-1\\/2 {\r\n width: 50%;\r\n}\r\n```\r\n\r\nAnd use this simple layout to see the issue\r\n```HTML\r\n\u003cStackLayout\u003e\r\n \u003cLabel class=\"w-1\" backgroundColor=\"red\" /\u003e\r\n \u003cLabel class=\"w-1/2\" backgroundColor=\"blue\" /\u003e\r\n\u003c/StackLayout\u003e\r\n```\r\n\u003c!-- Add commands used or steps taken to reproduce the behaviour. --\u003e\r\n\r\n**Expected behavior**\r\n\r\nI would expect the `red` label to be `width: 25` and the `blue` label to be `width: 50%`.\r\n\r\nWhat is actually happening:\r\n * `red` is `width: 50%`\r\n * `blue` is `width: auto` (or whatever is default)\r\n\r\n**Sample project**\r\n\r\nhttps://play.nativescript.org/?template=play-vue\u0026id=kMFahL\r\n\u003c!-- If possible, provide a link from the [Playground](https://play.nativescript.org) with reproduction of the problem. If not, consider attaching a sample project or link to a repository with such project. --\u003e\r\n\r\n**Additional context**\r\n\r\nI have tracked the issue down to the css parser, more specifically this part:\r\n\r\nhttps://github.com/NativeScript/NativeScript/blob/c0b8db40982825f8e14b70f5a5d2fece17d06337/tns-core-modules/css/parser.ts#L737-L750\r\n\r\nI'm working on a PR to fix this issue.\r\n\u003c!-- Add any other context about the problem here. --\u003e\r\n","author":{"url":"https://github.com/rigor789","@type":"Person","name":"rigor789"},"datePublished":"2019-08-17T11:55:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/7688/NativeScript/issues/7688"}
| 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:5e5b0b32-23a7-1cda-b08b-5f44602f65a9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92DA:128756:3B2493F:5060721:6971FC72 |
| html-safe-nonce | 5d9eeec5275ad94046f499101301758299292c045823dce1c4ed91d56fcc693e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkRBOjEyODc1NjozQjI0OTNGOjUwNjA3MjE6Njk3MUZDNzIiLCJ2aXNpdG9yX2lkIjoiMjIyNjg0NDk3NzQyNzc3NDU3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 00c34721dee7baa1cdeecc84fab706be3e38b7981d70a76244269b38354771af |
| hovercard-subject-tag | issue:481878503 |
| 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/NativeScript/NativeScript/7688/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1d37b5e41f4eb0dad10f58d847034e5023b66a91e48912d1045addd26008e434/NativeScript/NativeScript/issues/7688 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1d37b5e41f4eb0dad10f58d847034e5023b66a91e48912d1045addd26008e434/NativeScript/NativeScript/issues/7688 |
| og:image:alt | Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.0... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rigor789 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5d01a3551afdd1a0e12e78acaf3ba43a9a1f7dcb518695d6ed59db76a9290f13 |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| 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 | 062b05dcdf64ee7a3dad7acabb746494ae0982cc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width