Custom Property inherit vs initial
Custom-property initial is guaranteed-invalid unless registered with supplied initial token; inherit uses parent independently computed value, not ordinary property default. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.
Description
An unregistered custom property's initial value is guaranteed-invalid.
An unregistered custom property's initial value is guaranteed-invalid.1
A registered property's initial value and inheritance depend on its declared registration context. Use Custom Property inherit vs initial to evaluate the supplied inputs under the specific model below.
When to use Custom Property inherit vs initial
Use Custom Property inherit vs initial to evaluate the supplied inputs under the specific model below. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
How to use Custom Property inherit vs initial and understand its results
- Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
- Enter Keyword, Is registered, Caller parent computed token, Caller registered initial token using the field table and validation rules below, then run the tool.
- Read Resolved custom property token, Guaranteed invalid and interpret units, signs, ordering and placeholders as explained below.
- If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| keyword | Keyword | string | Required; constraints below |
| isRegistered | Is registered | boolean | Required; constraints below |
| callerParentComputedToken | Caller parent computed token | string | Required; constraints below |
| callerRegisteredInitialToken | Caller registered initial token | string | Required; constraints below |
Enter exactly inherit or initial, a registration boolean and parent and registered-initial token strings. inherit returns the supplied parent value. initial returns the registered initial value when registered, otherwise an empty-string placeholder with the guaranteed-invalid flag true. The empty string represents this result state rather than a valid empty CSS value. No registration syntax or full cascade is evaluated.
inherit→parent; registered initial→registeredInitial; unregistered initial→guaranteed-invalid placeholder Field order, units and branch conditions follow the implementation explanation above.
| Output field | Meaning | Value type |
|---|---|---|
| resolvedCustomPropertyToken | Resolved custom property token | string |
| guaranteedInvalid | Guaranteed invalid | boolean |
{
"input": {
"keyword": "initial",
"isRegistered": false,
"callerParentComputedToken": "red",
"callerRegisteredInitialToken": "blue"
},
"output": {
"resolvedCustomPropertyToken": "",
"guaranteedInvalid": true
}
} Limitations and assumptions
An unregistered custom property’s initial value is guaranteed-invalid. The flag distinguishes that state from the tool’s empty-string output placeholder.2
A registered property's initial value and inheritance depend on its declared registration context. Apply the exact scope and assumptions described above.
All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.
Alternative or Complementary methods
Use all:unset Reset Behavior Lookup for a related task: All unset applies inheritance or initial-value behavior with defined exclusions.
Use inherit/initial/unset/revert Resolution Table for a related task: CSS-wide keywords choose parent, initial or rollback values under defined rules.
References
Similar or alternative tools
- all:unset Reset Behavior Lookup
All unset applies inheritance or initial-value behavior with defined exclusions.
- inherit/initial/unset/revert Resolution Table
CSS-wide keywords choose parent, initial or rollback values under defined rules.