GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — CSS Variable Namespacing by mattrbeck · Pull Request #68846 · angular/angular Conversation
|
| // Validate that the whole `--foo` variable is passed in. | ||
| if (typeof ngDevMode === 'undefined' || ngDevMode) { | ||
| if (!name.startsWith('--')) { | ||
| throw new Error( |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a RuntimeError ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that RuntimeError is more for errors from framework internals that might not present clean stack traces and warrant additional documentation. The precedent I see is using Error in cases like this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
e95f942 to
5dd7961
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks great, no major concerns on my end. Thanks for taking this on @mattrbeck!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
3c2ce20 to
af7d747
Compare
af7d747 to
73bad82
Compare
Adds logic to inject symbols into CSS variables for runtime namespacing. The runtime now replaces instances of `%NS%` with a namespacing variable, limiting reach of CSS variables to the current app. An opt-out syntax of a `--global` prefix allows users to avoid this behavior.
Using `--global-foo` is now prohibited. We suspect these cases will likely be typos of `--global--foo` in the future, so we blanket ban them and direct users to the expected syntax.
Adds support for namespacing css variables in style properties. Behaves as you'd expect following the implementation for stylesheets generally. This change also moves the error message into a util function since we now need to produce the same error in three places.
... for now. Should be enabled in the next major.
73bad82 to
9c1a257
Compare
|
Caretaker: TGP is green as of July 1. Possibility for backslide if a new CSS variable beginning with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Using `--global-foo` is now prohibited. We suspect these cases will likely be typos of `--global--foo` in the future, so we blanket ban them and direct users to the expected syntax. PR Close #68846
Adds support for namespacing css variables in style properties. Behaves as you'd expect following the implementation for stylesheets generally. This change also moves the error message into a util function since we now need to produce the same error in three places. PR Close #68846
... for now. Should be enabled in the next major. PR Close #68846
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.