[system] Allow values to use shorter string when the prop name is contained in the value #23635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the API for some of the system props looks awkward as you need to the type the prop name as part of the value.
For example:
This PR proposes solution for this, so that the definition could look like:
The implementation is done in the following manner. First, the value is looked upon as it was before. If there is no value found, we are trying to prepend the prop name to the value and look for that. If the value was
default
we are simply looking for the prop name.This is currently done automatically for all system values. We may add a flag for it and use it whenever we think necessary, but I would say this is good default behavior.
Regarding the naming of the
default
as it is already a value for some CSS properties, likecursor
we may try to think of a different name. However, for the properties we have so far in the system I don't think it will be an issue.Closes #23192
Closes #17615