PUNGGOL TUITION · PRACTICAL MASTERY GUIDE
If a CSS fallback looks correct but fails after a custom property is substituted, the missing idea is often evaluation timing. The draft first-valid() function is designed to choose the first whole property value that is supported and valid.
The rule is ordered and bounded: candidates are comma-separated declaration values, the first supported valid whole value represents the function, and if none is valid the property is invalid at computed-value time. This is exploratory Level 5 syntax, so ordinary fallbacks and target-browser checks remain essential.
This guide treats CSS first-valid() as a reasoning skill. It begins with the governing model, moves through worked examples and diagnostic routes, and ends with transfer cases, practice with explained answers, parent decisions and FAQs. The examples are proposed home or lesson activities; they are not claims about a physical Punggol branch, school affiliation, timetable, class size, fee or guaranteed result.
For a Punggol family, the practical aim is simple: a learner should be able to use a short study block before schoolwork, after CCA, or during a weekend library session without needing a large project. Each chapter is designed so the smallest useful example can be completed, discussed and saved as a test fixture.
The official technical reference for this article is CSS Values and Units Level 5 draft. Where the feature is version-sensitive or still developing, the article states that boundary explicitly. Examples were independently checked against the runtime or specification named in the reference section.
Choose a reading route
If the immediate concern is “I can copy the syntax but I cannot explain the result”, use the first route. If a real project is already failing, use the diagnostic route. Parents can use the final route to decide whether more practice, a smaller prerequisite or a different example is needed. For the wider learning framework, see How Studying Works.
Start from the model: Chapters 1–4. Begin with The fallback problem it addresses and continue in order to Comma-separated candidate syntax.
Diagnose a confusing result: Chapters 5–8. Begin with A whole-property value and continue in order to Custom-property input.
Build reliable examples: Chapters 9–12. Begin with Nested functions stay one candidate and continue in order to first-valid() versus @supports.
Transfer to real work: Chapters 13–16. Begin with first-valid() versus repeated declarations and continue in order to Computed-value timing.
Decide and teach: Chapters 17–20. Begin with Progressive enhancement outside the function and continue in order to Choosing the right fallback tool.
Open the full 20-chapter index
- 1. The fallback problem it addresses
- 2. Ordinary repeated declarations
- 3. Late substitution with var()
- 4. Comma-separated candidate syntax
- 5. A whole-property value
- 6. First means ordered preference
- 7. No valid candidate
- 8. Custom-property input
- 9. Nested functions stay one candidate
- 10. Free-form declaration values
- 11. first-valid() versus var() fallback
- 12. first-valid() versus @supports
- 13. first-valid() versus repeated declarations
- 14. CSS-wide keywords
- 15. Inheritance after invalidity
- 16. Computed-value timing
- 17. Progressive enhancement outside the function
- 18. DevTools diagnosis
- 19. Draft status and target browsers
- 20. Choosing the right fallback tool
CHAPTER 1 OF 20 · Back to contents
1. The fallback problem it addresses
The short answer: The fallback problem it addresses is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the the fallback problem it addresses example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: first-valid(oklch(60% 0.2 40), #b45309);
Expected result and reasoning. In a supporting implementation, the first valid whole color value wins. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Calling it a general if statement ignores its property-value and validity contract. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Which complete candidate value is examined first?”
- Evidence to collect: the exact input, environment version, observed result and the rule for the fallback problem it addresses
- Variable to hold constant: the surrounding setup, so the comparison isolates the fallback problem it addresses.
- Variable to change: reverse the candidate order
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For the fallback problem it addresses, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a card gallery. Transfer the fallback problem it addresses into a card gallery. Preserve the governing rule—first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.—while identifying what changes in this setting. The fallback problem it addresses is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a component library. Transfer the fallback problem it addresses into a component library. Preserve the governing rule—first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.—while identifying what changes in this setting. The fallback problem it addresses is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a browser-support test. Transfer the fallback problem it addresses into a browser-support test. Preserve the governing rule—first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.—while identifying what changes in this setting. The fallback problem it addresses is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a visual regression fixture. Transfer the fallback problem it addresses into a visual regression fixture. Preserve the governing rule—first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.—while identifying what changes in this setting. The fallback problem it addresses is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() represents the first comma-separated argument that is supported and valid as the whole property value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for the fallback problem it addresses, predict the result, then reverse the candidate order. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. In a supporting implementation, the first valid whole color value wins. The contrast follows from this rule: first-valid() represents the first comma-separated argument that is supported and valid as the whole property value. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for the fallback problem it addresses, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain the fallback problem it addresses, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Contents · Full contents · Next: Ordinary repeated declarations →
CHAPTER 2 OF 20 · Back to contents
2. Ordinary repeated declarations
The short answer: Ordinary repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: When parse-time support is enough, repeated declarations remain the established fallback technique.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “When parse-time support is enough, repeated declarations remain the established fallback technique.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the ordinary repeated declarations example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: #b45309;
color: oklch(60% 0.2 40);
Expected result and reasoning. Browsers that reject the later declaration retain the earlier supported declaration. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Deleting the ordinary fallback because first-valid() exists can reduce compatibility. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Can the browser reject the candidate while parsing the declaration?”
- Evidence to collect: the exact input, environment version, observed result and the rule for ordinary repeated declarations
- Variable to hold constant: the surrounding setup, so the comparison isolates ordinary repeated declarations.
- Variable to change: test the stylesheet in an older target browser
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For ordinary repeated declarations, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a celebration page. Transfer ordinary repeated declarations into a celebration page. Preserve the governing rule—When parse-time support is enough, repeated declarations remain the established fallback technique.—while identifying what changes in this setting. Ordinary repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “When parse-time support is enough, repeated declarations remain the established fallback technique.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a classroom demo. Transfer ordinary repeated declarations into a classroom demo. Preserve the governing rule—When parse-time support is enough, repeated declarations remain the established fallback technique.—while identifying what changes in this setting. Ordinary repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “When parse-time support is enough, repeated declarations remain the established fallback technique.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a design-token layer. Transfer ordinary repeated declarations into a design-token layer. Preserve the governing rule—When parse-time support is enough, repeated declarations remain the established fallback technique.—while identifying what changes in this setting. Ordinary repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “When parse-time support is enough, repeated declarations remain the established fallback technique.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a progressive-enhancement review. Transfer ordinary repeated declarations into a progressive-enhancement review. Preserve the governing rule—When parse-time support is enough, repeated declarations remain the established fallback technique.—while identifying what changes in this setting. Ordinary repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “When parse-time support is enough, repeated declarations remain the established fallback technique.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for ordinary repeated declarations, predict the result, then test the stylesheet in an older target browser. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. Browsers that reject the later declaration retain the earlier supported declaration. The contrast follows from this rule: When parse-time support is enough, repeated declarations remain the established fallback technique. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for ordinary repeated declarations, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain ordinary repeated declarations, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: The fallback problem it addresses · Full contents · Next: Late substitution with var() →
CHAPTER 3 OF 20 · Back to contents
3. Late substitution with var()
The short answer: Late substitution with var() is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the late substitution with var() example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
--accent: oklch(60% 0.2 40);
color: first-valid(var(--accent), #b45309);
Expected result and reasoning. A supporting engine can choose the fallback if the substituted first candidate is invalid for color. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Two declarations may not rescue an invalid-at-computed-value substitution after cascade selection. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “When does the candidate become invalid?”
- Evidence to collect: the exact input, environment version, observed result and the rule for late substitution with var()
- Variable to hold constant: the surrounding setup, so the comparison isolates late substitution with var().
- Variable to change: make –accent a valid hex color
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For late substitution with var(), a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a component library. Transfer late substitution with var() into a component library. Preserve the governing rule—first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.—while identifying what changes in this setting. Late substitution with var() is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a browser-support test. Transfer late substitution with var() into a browser-support test. Preserve the governing rule—first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.—while identifying what changes in this setting. Late substitution with var() is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a visual regression fixture. Transfer late substitution with var() into a visual regression fixture. Preserve the governing rule—first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.—while identifying what changes in this setting. Late substitution with var() is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a card gallery. Transfer late substitution with var() into a card gallery. Preserve the governing rule—first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.—while identifying what changes in this setting. Late substitution with var() is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for late substitution with var(), predict the result, then make –accent a valid hex color. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. A supporting engine can choose the fallback if the substituted first candidate is invalid for color. The contrast follows from this rule: first-valid() is motivated by cases where var() and similar substitution defer validity until the cascade has already selected a declaration. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for late substitution with var(), then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain late substitution with var(), solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Ordinary repeated declarations · Full contents · Next: Comma-separated candidate syntax →
CHAPTER 4 OF 20 · Back to contents
4. Comma-separated candidate syntax
The short answer: Comma-separated candidate syntax is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: first-valid() accepts one or more declaration-value candidates separated by commas.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “first-valid() accepts one or more declaration-value candidates separated by commas.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the comma-separated candidate syntax example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
width: first-valid(calc(10px + 2vi), 12px);
Expected result and reasoning. A supporting engine considers candidates from left to right. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. A comma belonging to a nested function must not be mistaken for a top-level candidate separator. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Which commas are nested and which separate candidates?”
- Evidence to collect: the exact input, environment version, observed result and the rule for comma-separated candidate syntax
- Variable to hold constant: the surrounding setup, so the comparison isolates comma-separated candidate syntax.
- Variable to change: wrap a multi-argument function as one candidate
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For comma-separated candidate syntax, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a classroom demo. Transfer comma-separated candidate syntax into a classroom demo. Preserve the governing rule—first-valid() accepts one or more declaration-value candidates separated by commas.—while identifying what changes in this setting. Comma-separated candidate syntax is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() accepts one or more declaration-value candidates separated by commas.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a design-token layer. Transfer comma-separated candidate syntax into a design-token layer. Preserve the governing rule—first-valid() accepts one or more declaration-value candidates separated by commas.—while identifying what changes in this setting. Comma-separated candidate syntax is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() accepts one or more declaration-value candidates separated by commas.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a progressive-enhancement review. Transfer comma-separated candidate syntax into a progressive-enhancement review. Preserve the governing rule—first-valid() accepts one or more declaration-value candidates separated by commas.—while identifying what changes in this setting. Comma-separated candidate syntax is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() accepts one or more declaration-value candidates separated by commas.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a celebration page. Transfer comma-separated candidate syntax into a celebration page. Preserve the governing rule—first-valid() accepts one or more declaration-value candidates separated by commas.—while identifying what changes in this setting. Comma-separated candidate syntax is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() accepts one or more declaration-value candidates separated by commas.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for comma-separated candidate syntax, predict the result, then wrap a multi-argument function as one candidate. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. A supporting engine considers candidates from left to right. The contrast follows from this rule: first-valid() accepts one or more declaration-value candidates separated by commas. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for comma-separated candidate syntax, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain comma-separated candidate syntax, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Late substitution with var() · Full contents · Next: A whole-property value →
CHAPTER 5 OF 20 · Back to contents
5. A whole-property value
The short answer: A whole-property value is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the a whole-property value example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
background: first-valid(linear-gradient(red,blue), red);
Expected result and reasoning. Each argument is considered as a complete background value. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Using first-valid() as one token among unrelated outer tokens conflicts with the draft’s whole-value model. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “What complete value would be assigned to the property?”
- Evidence to collect: the exact input, environment version, observed result and the rule for a whole-property value
- Variable to hold constant: the surrounding setup, so the comparison isolates a whole-property value.
- Variable to change: express every candidate as a complete background value
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For a whole-property value, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a browser-support test. Transfer a whole-property value into a browser-support test. Preserve the governing rule—The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.—while identifying what changes in this setting. A whole-property value is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a visual regression fixture. Transfer a whole-property value into a visual regression fixture. Preserve the governing rule—The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.—while identifying what changes in this setting. A whole-property value is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a card gallery. Transfer a whole-property value into a card gallery. Preserve the governing rule—The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.—while identifying what changes in this setting. A whole-property value is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a component library. Transfer a whole-property value into a component library. Preserve the governing rule—The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.—while identifying what changes in this setting. A whole-property value is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The function stands for the property’s entire value and is not an arbitrary substring inside a larger value.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for a whole-property value, predict the result, then express every candidate as a complete background value. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. Each argument is considered as a complete background value. The contrast follows from this rule: The function stands for the property’s entire value and is not an arbitrary substring inside a larger value. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for a whole-property value, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain a whole-property value, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Comma-separated candidate syntax · Full contents · Next: First means ordered preference →
CHAPTER 6 OF 20 · Back to contents
6. First means ordered preference
The short answer: First means ordered preference is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: The earliest supported and valid candidate wins, so order states a design preference.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “The earliest supported and valid candidate wins, so order states a design preference.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the first means ordered preference example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: first-valid(color(display-p3 1 0.3 0), rgb(255 60 0), red);
Expected result and reasoning. A supporting engine chooses the first candidate it can validly use as color. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Ordering the safest fallback first prevents enhanced candidates from being reached. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Is the list strongest preference to broadest fallback?”
- Evidence to collect: the exact input, environment version, observed result and the rule for first means ordered preference
- Variable to hold constant: the surrounding setup, so the comparison isolates first means ordered preference.
- Variable to change: swap the first and last candidates
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For first means ordered preference, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a design-token layer. Transfer first means ordered preference into a design-token layer. Preserve the governing rule—The earliest supported and valid candidate wins, so order states a design preference.—while identifying what changes in this setting. First means ordered preference is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The earliest supported and valid candidate wins, so order states a design preference.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a progressive-enhancement review. Transfer first means ordered preference into a progressive-enhancement review. Preserve the governing rule—The earliest supported and valid candidate wins, so order states a design preference.—while identifying what changes in this setting. First means ordered preference is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The earliest supported and valid candidate wins, so order states a design preference.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a celebration page. Transfer first means ordered preference into a celebration page. Preserve the governing rule—The earliest supported and valid candidate wins, so order states a design preference.—while identifying what changes in this setting. First means ordered preference is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The earliest supported and valid candidate wins, so order states a design preference.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a classroom demo. Transfer first means ordered preference into a classroom demo. Preserve the governing rule—The earliest supported and valid candidate wins, so order states a design preference.—while identifying what changes in this setting. First means ordered preference is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The earliest supported and valid candidate wins, so order states a design preference.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for first means ordered preference, predict the result, then swap the first and last candidates. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. A supporting engine chooses the first candidate it can validly use as color. The contrast follows from this rule: The earliest supported and valid candidate wins, so order states a design preference. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for first means ordered preference, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain first means ordered preference, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: A whole-property value · Full contents · Next: No valid candidate →
CHAPTER 7 OF 20 · Back to contents
7. No valid candidate
The short answer: No valid candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: If none of the arguments is valid, the property becomes invalid at computed-value time.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “If none of the arguments is valid, the property becomes invalid at computed-value time.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the no valid candidate example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: first-valid(12px, rotate(10deg));
Expected result and reasoning. Neither candidate is a color, so the declaration cannot provide a valid computed color. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Assuming the browser invents a magic fallback conceals normal inheritance or initial-value consequences. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “What does the property do when the declaration is invalid?”
- Evidence to collect: the exact input, environment version, observed result and the rule for no valid candidate
- Variable to hold constant: the surrounding setup, so the comparison isolates no valid candidate.
- Variable to change: append a valid named color
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For no valid candidate, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a visual regression fixture. Transfer no valid candidate into a visual regression fixture. Preserve the governing rule—If none of the arguments is valid, the property becomes invalid at computed-value time.—while identifying what changes in this setting. No valid candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If none of the arguments is valid, the property becomes invalid at computed-value time.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a card gallery. Transfer no valid candidate into a card gallery. Preserve the governing rule—If none of the arguments is valid, the property becomes invalid at computed-value time.—while identifying what changes in this setting. No valid candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If none of the arguments is valid, the property becomes invalid at computed-value time.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a component library. Transfer no valid candidate into a component library. Preserve the governing rule—If none of the arguments is valid, the property becomes invalid at computed-value time.—while identifying what changes in this setting. No valid candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If none of the arguments is valid, the property becomes invalid at computed-value time.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a browser-support test. Transfer no valid candidate into a browser-support test. Preserve the governing rule—If none of the arguments is valid, the property becomes invalid at computed-value time.—while identifying what changes in this setting. No valid candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If none of the arguments is valid, the property becomes invalid at computed-value time.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for no valid candidate, predict the result, then append a valid named color. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. Neither candidate is a color, so the declaration cannot provide a valid computed color. The contrast follows from this rule: If none of the arguments is valid, the property becomes invalid at computed-value time. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for no valid candidate, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain no valid candidate, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: First means ordered preference · Full contents · Next: Custom-property input →
CHAPTER 8 OF 20 · Back to contents
8. Custom-property input
The short answer: Custom-property input is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: A custom property can feed a candidate, but the receiving property determines validity after substitution.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “A custom property can feed a candidate, but the receiving property determines validity after substitution.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the custom-property input example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
--choice: 20px;
color: first-valid(var(--choice), rebeccapurple);
Expected result and reasoning. A supporting engine rejects 20px as a color candidate and can use rebeccapurple. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Calling the custom property valid merely because custom properties accept tokens misses receiving-property grammar. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Valid for which property and at which stage?”
- Evidence to collect: the exact input, environment version, observed result and the rule for custom-property input
- Variable to hold constant: the surrounding setup, so the comparison isolates custom-property input.
- Variable to change: change –choice to #663399
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For custom-property input, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a progressive-enhancement review. Transfer custom-property input into a progressive-enhancement review. Preserve the governing rule—A custom property can feed a candidate, but the receiving property determines validity after substitution.—while identifying what changes in this setting. Custom-property input is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A custom property can feed a candidate, but the receiving property determines validity after substitution.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a celebration page. Transfer custom-property input into a celebration page. Preserve the governing rule—A custom property can feed a candidate, but the receiving property determines validity after substitution.—while identifying what changes in this setting. Custom-property input is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A custom property can feed a candidate, but the receiving property determines validity after substitution.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a classroom demo. Transfer custom-property input into a classroom demo. Preserve the governing rule—A custom property can feed a candidate, but the receiving property determines validity after substitution.—while identifying what changes in this setting. Custom-property input is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A custom property can feed a candidate, but the receiving property determines validity after substitution.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a design-token layer. Transfer custom-property input into a design-token layer. Preserve the governing rule—A custom property can feed a candidate, but the receiving property determines validity after substitution.—while identifying what changes in this setting. Custom-property input is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A custom property can feed a candidate, but the receiving property determines validity after substitution.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for custom-property input, predict the result, then change –choice to #663399. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. A supporting engine rejects 20px as a color candidate and can use rebeccapurple. The contrast follows from this rule: A custom property can feed a candidate, but the receiving property determines validity after substitution. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for custom-property input, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain custom-property input, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: No valid candidate · Full contents · Next: Nested functions stay one candidate →
CHAPTER 9 OF 20 · Back to contents
9. Nested functions stay one candidate
The short answer: Nested functions stay one candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: A nested function, including its internal commas, is parsed as part of one declaration-value candidate.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “A nested function, including its internal commas, is parsed as part of one declaration-value candidate.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the nested functions stay one candidate example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
background: first-valid(rgb(20, 40, 60), #14283c);
Expected result and reasoning. rgb(20, 40, 60) is one candidate rather than three. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Counting commas without respecting nesting misreads the candidate list. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “What is the parenthesis depth of each comma?”
- Evidence to collect: the exact input, environment version, observed result and the rule for nested functions stay one candidate
- Variable to hold constant: the surrounding setup, so the comparison isolates nested functions stay one candidate.
- Variable to change: use modern space-separated rgb syntax and compare
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For nested functions stay one candidate, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a card gallery. Transfer nested functions stay one candidate into a card gallery. Preserve the governing rule—A nested function, including its internal commas, is parsed as part of one declaration-value candidate.—while identifying what changes in this setting. Nested functions stay one candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A nested function, including its internal commas, is parsed as part of one declaration-value candidate.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a component library. Transfer nested functions stay one candidate into a component library. Preserve the governing rule—A nested function, including its internal commas, is parsed as part of one declaration-value candidate.—while identifying what changes in this setting. Nested functions stay one candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A nested function, including its internal commas, is parsed as part of one declaration-value candidate.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a browser-support test. Transfer nested functions stay one candidate into a browser-support test. Preserve the governing rule—A nested function, including its internal commas, is parsed as part of one declaration-value candidate.—while identifying what changes in this setting. Nested functions stay one candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A nested function, including its internal commas, is parsed as part of one declaration-value candidate.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a visual regression fixture. Transfer nested functions stay one candidate into a visual regression fixture. Preserve the governing rule—A nested function, including its internal commas, is parsed as part of one declaration-value candidate.—while identifying what changes in this setting. Nested functions stay one candidate is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “A nested function, including its internal commas, is parsed as part of one declaration-value candidate.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for nested functions stay one candidate, predict the result, then use modern space-separated rgb syntax and compare. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. rgb(20, 40, 60) is one candidate rather than three. The contrast follows from this rule: A nested function, including its internal commas, is parsed as part of one declaration-value candidate. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for nested functions stay one candidate, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain nested functions stay one candidate, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Custom-property input · Full contents · Next: Free-form declaration values →
CHAPTER 10 OF 20 · Back to contents
10. Free-form declaration values
The short answer: Free-form declaration values is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the free-form declaration values example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
border: first-valid(2px solid color(display-p3 1 0 0), 2px solid red);
Expected result and reasoning. Each candidate must form a complete valid border value. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Validating fragments independently can miss invalid combinations in the full shorthand. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Does the entire shorthand candidate satisfy border grammar?”
- Evidence to collect: the exact input, environment version, observed result and the rule for free-form declaration values
- Variable to hold constant: the surrounding setup, so the comparison isolates free-form declaration values.
- Variable to change: split the experiment into border-color and full border
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For free-form declaration values, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a celebration page. Transfer free-form declaration values into a celebration page. Preserve the governing rule—The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.—while identifying what changes in this setting. Free-form declaration values is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a classroom demo. Transfer free-form declaration values into a classroom demo. Preserve the governing rule—The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.—while identifying what changes in this setting. Free-form declaration values is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a design-token layer. Transfer free-form declaration values into a design-token layer. Preserve the governing rule—The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.—while identifying what changes in this setting. Free-form declaration values is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a progressive-enhancement review. Transfer free-form declaration values into a progressive-enhancement review. Preserve the governing rule—The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.—while identifying what changes in this setting. Free-form declaration values is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for free-form declaration values, predict the result, then split the experiment into border-color and full border. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. Each candidate must form a complete valid border value. The contrast follows from this rule: The draft grammar accepts declaration-value arguments, so interpretation depends on the property that receives the result. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for free-form declaration values, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain free-form declaration values, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Nested functions stay one candidate · Full contents · Next: first-valid() versus var() fallback →
CHAPTER 11 OF 20 · Back to contents
11. first-valid() versus var() fallback
The short answer: first-valid() versus var() fallback is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the first-valid() versus var() fallback example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
--x: 20px;
color: var(--x, red);
Expected result and reasoning. The presence of –x prevents the var fallback even though 20px is unsuitable for color. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Treating var fallback as type-aware property fallback teaches the wrong evaluation model. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Was –x missing, or merely unsuitable for color?”
- Evidence to collect: the exact input, environment version, observed result and the rule for first-valid() versus var() fallback
- Variable to hold constant: the surrounding setup, so the comparison isolates first-valid() versus var() fallback.
- Variable to change: remove –x and compare
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For first-valid() versus var() fallback, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a component library. Transfer first-valid() versus var() fallback into a component library. Preserve the governing rule—var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.—while identifying what changes in this setting. first-valid() versus var() fallback is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a browser-support test. Transfer first-valid() versus var() fallback into a browser-support test. Preserve the governing rule—var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.—while identifying what changes in this setting. first-valid() versus var() fallback is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a visual regression fixture. Transfer first-valid() versus var() fallback into a visual regression fixture. Preserve the governing rule—var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.—while identifying what changes in this setting. first-valid() versus var() fallback is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a card gallery. Transfer first-valid() versus var() fallback into a card gallery. Preserve the governing rule—var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.—while identifying what changes in this setting. first-valid() versus var() fallback is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for first-valid() versus var() fallback, predict the result, then remove –x and compare. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. The presence of –x prevents the var fallback even though 20px is unsuitable for color. The contrast follows from this rule: var(–x, fallback) uses its fallback when the custom property is missing or invalid as a custom-property substitution, not whenever the substituted tokens fail the receiving property. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for first-valid() versus var() fallback, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain first-valid() versus var() fallback, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Free-form declaration values · Full contents · Next: first-valid() versus @supports →
CHAPTER 12 OF 20 · Back to contents
12. first-valid() versus @supports
The short answer: first-valid() versus @supports is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: @supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the first-valid() versus @supports example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
@supports (color: oklch(60% 0.2 40)) { .card { color: oklch(60% 0.2 40); } }
Expected result and reasoning. The conditional rule is appropriate when a larger block of declarations depends on support. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Replacing all feature queries with a value function can obscure multi-property enhancement. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Is the decision one value or a block of styles?”
- Evidence to collect: the exact input, environment version, observed result and the rule for first-valid() versus @supports
- Variable to hold constant: the surrounding setup, so the comparison isolates first-valid() versus @supports.
- Variable to change: put two dependent declarations inside @supports
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For first-valid() versus @supports, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a classroom demo. Transfer first-valid() versus @supports into a classroom demo. Preserve the governing rule—@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.—while identifying what changes in this setting. first-valid() versus @supports is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a design-token layer. Transfer first-valid() versus @supports into a design-token layer. Preserve the governing rule—@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.—while identifying what changes in this setting. first-valid() versus @supports is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a progressive-enhancement review. Transfer first-valid() versus @supports into a progressive-enhancement review. Preserve the governing rule—@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.—while identifying what changes in this setting. first-valid() versus @supports is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a celebration page. Transfer first-valid() versus @supports into a celebration page. Preserve the governing rule—@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.—while identifying what changes in this setting. first-valid() versus @supports is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “@supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for first-valid() versus @supports, predict the result, then put two dependent declarations inside @supports. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. The conditional rule is appropriate when a larger block of declarations depends on support. The contrast follows from this rule: @supports tests whether a browser supports a declaration condition; first-valid() chooses among whole values during value processing. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for first-valid() versus @supports, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain first-valid() versus @supports, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: first-valid() versus var() fallback · Full contents · Next: first-valid() versus repeated declarations →
CHAPTER 13 OF 20 · Back to contents
13. first-valid() versus repeated declarations
The short answer: first-valid() versus repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the first-valid() versus repeated declarations example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: #b45309;
color: var(--theme-color);
Expected result and reasoning. If var substitution later makes the chosen declaration invalid, the earlier declaration is not automatically reselected. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Assuming the cascade rewinds after computed-value failure confuses evaluation stages. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Which declaration won before substitution completed?”
- Evidence to collect: the exact input, environment version, observed result and the rule for first-valid() versus repeated declarations
- Variable to hold constant: the surrounding setup, so the comparison isolates first-valid() versus repeated declarations.
- Variable to change: use a supporting first-valid() experiment plus an outer fallback
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For first-valid() versus repeated declarations, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a browser-support test. Transfer first-valid() versus repeated declarations into a browser-support test. Preserve the governing rule—Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.—while identifying what changes in this setting. first-valid() versus repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a visual regression fixture. Transfer first-valid() versus repeated declarations into a visual regression fixture. Preserve the governing rule—Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.—while identifying what changes in this setting. first-valid() versus repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a card gallery. Transfer first-valid() versus repeated declarations into a card gallery. Preserve the governing rule—Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.—while identifying what changes in this setting. first-valid() versus repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a component library. Transfer first-valid() versus repeated declarations into a component library. Preserve the governing rule—Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.—while identifying what changes in this setting. first-valid() versus repeated declarations is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for first-valid() versus repeated declarations, predict the result, then use a supporting first-valid() experiment plus an outer fallback. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. If var substitution later makes the chosen declaration invalid, the earlier declaration is not automatically reselected. The contrast follows from this rule: Repeated declarations are simpler for parse-time fallbacks; first-valid() targets late-validity situations that repetition cannot express reliably. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for first-valid() versus repeated declarations, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain first-valid() versus repeated declarations, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: first-valid() versus @supports · Full contents · Next: CSS-wide keywords →
CHAPTER 14 OF 20 · Back to contents
14. CSS-wide keywords
The short answer: CSS-wide keywords is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the css-wide keywords example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: first-valid(var(--accent), inherit);
Expected result and reasoning. In a supporting engine, inherit is a complete fallback candidate for color. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Treating inherit as an ordinary color token hides its dependency on the parent. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “What value source does the keyword select?”
- Evidence to collect: the exact input, environment version, observed result and the rule for css-wide keywords
- Variable to hold constant: the surrounding setup, so the comparison isolates css-wide keywords.
- Variable to change: compare inherit and initial in a nested fixture
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For css-wide keywords, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a design-token layer. Transfer css-wide keywords into a design-token layer. Preserve the governing rule—Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.—while identifying what changes in this setting. CSS-wide keywords is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a progressive-enhancement review. Transfer css-wide keywords into a progressive-enhancement review. Preserve the governing rule—Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.—while identifying what changes in this setting. CSS-wide keywords is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a celebration page. Transfer css-wide keywords into a celebration page. Preserve the governing rule—Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.—while identifying what changes in this setting. CSS-wide keywords is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a classroom demo. Transfer css-wide keywords into a classroom demo. Preserve the governing rule—Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.—while identifying what changes in this setting. CSS-wide keywords is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for css-wide keywords, predict the result, then compare inherit and initial in a nested fixture. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. In a supporting engine, inherit is a complete fallback candidate for color. The contrast follows from this rule: Keywords such as inherit, initial, unset, revert and revert-layer have special property-wide meanings and require careful whole-value reasoning. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for css-wide keywords, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain css-wide keywords, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: first-valid() versus repeated declarations · Full contents · Next: Inheritance after invalidity →
CHAPTER 15 OF 20 · Back to contents
15. Inheritance after invalidity
The short answer: Inheritance after invalidity is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the inheritance after invalidity example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
.parent{color:navy}.child{color:first-valid(12px,20px)}
Expected result and reasoning. With no valid candidate in a supporting engine, the child’s color follows the property’s invalid-declaration and inheritance rules. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Saying the result is always black ignores parent value and user-agent context. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Is the property inherited by default?”
- Evidence to collect: the exact input, environment version, observed result and the rule for inheritance after invalidity
- Variable to hold constant: the surrounding setup, so the comparison isolates inheritance after invalidity.
- Variable to change: change the parent color and observe the dependent result
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For inheritance after invalidity, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a visual regression fixture. Transfer inheritance after invalidity into a visual regression fixture. Preserve the governing rule—If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.—while identifying what changes in this setting. Inheritance after invalidity is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a card gallery. Transfer inheritance after invalidity into a card gallery. Preserve the governing rule—If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.—while identifying what changes in this setting. Inheritance after invalidity is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a component library. Transfer inheritance after invalidity into a component library. Preserve the governing rule—If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.—while identifying what changes in this setting. Inheritance after invalidity is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a browser-support test. Transfer inheritance after invalidity into a browser-support test. Preserve the governing rule—If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.—while identifying what changes in this setting. Inheritance after invalidity is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for inheritance after invalidity, predict the result, then change the parent color and observe the dependent result. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. With no valid candidate in a supporting engine, the child’s color follows the property’s invalid-declaration and inheritance rules. The contrast follows from this rule: If the declaration is invalid, the property’s normal inherited or initial behaviour still applies; first-valid() does not bypass CSS fundamentals. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for inheritance after invalidity, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain inheritance after invalidity, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: CSS-wide keywords · Full contents · Next: Computed-value timing →
CHAPTER 16 OF 20 · Back to contents
16. Computed-value timing
The short answer: Computed-value timing is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the computed-value timing example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color: first-valid(var(--maybe), #444);
Expected result and reasoning. The candidate outcome may depend on the substituted value of –maybe. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. A parser-only explanation cannot account for a syntactically accepted but semantically invalid substituted value. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “At what stage is the candidate known fully?”
- Evidence to collect: the exact input, environment version, observed result and the rule for computed-value timing
- Variable to hold constant: the surrounding setup, so the comparison isolates computed-value timing.
- Variable to change: test a missing variable and an unsuitable present variable
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For computed-value timing, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a progressive-enhancement review. Transfer computed-value timing into a progressive-enhancement review. Preserve the governing rule—The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.—while identifying what changes in this setting. Computed-value timing is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a celebration page. Transfer computed-value timing into a celebration page. Preserve the governing rule—The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.—while identifying what changes in this setting. Computed-value timing is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a classroom demo. Transfer computed-value timing into a classroom demo. Preserve the governing rule—The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.—while identifying what changes in this setting. Computed-value timing is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a design-token layer. Transfer computed-value timing into a design-token layer. Preserve the governing rule—The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.—while identifying what changes in this setting. Computed-value timing is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for computed-value timing, predict the result, then test a missing variable and an unsuitable present variable. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. The candidate outcome may depend on the substituted value of –maybe. The contrast follows from this rule: The feature is specifically tied to support and validity decisions that can occur after substitution, so record the evaluation stage in explanations. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for computed-value timing, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain computed-value timing, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Inheritance after invalidity · Full contents · Next: Progressive enhancement outside the function →
CHAPTER 17 OF 20 · Back to contents
17. Progressive enhancement outside the function
The short answer: Progressive enhancement outside the function is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the progressive enhancement outside the function example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
color:#b45309;
color:first-valid(var(--accent),#b45309);
Expected result and reasoning. A browser that rejects the experimental declaration can keep #b45309. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Publishing only the experimental declaration turns feature absence into unintended styling. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “What does a browser without first-valid() retain?”
- Evidence to collect: the exact input, environment version, observed result and the rule for progressive enhancement outside the function
- Variable to hold constant: the surrounding setup, so the comparison isolates progressive enhancement outside the function.
- Variable to change: disable the experimental line and compare
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For progressive enhancement outside the function, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a card gallery. Transfer progressive enhancement outside the function into a card gallery. Preserve the governing rule—Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.—while identifying what changes in this setting. Progressive enhancement outside the function is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a component library. Transfer progressive enhancement outside the function into a component library. Preserve the governing rule—Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.—while identifying what changes in this setting. Progressive enhancement outside the function is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a browser-support test. Transfer progressive enhancement outside the function into a browser-support test. Preserve the governing rule—Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.—while identifying what changes in this setting. Progressive enhancement outside the function is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a visual regression fixture. Transfer progressive enhancement outside the function into a visual regression fixture. Preserve the governing rule—Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.—while identifying what changes in this setting. Progressive enhancement outside the function is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for progressive enhancement outside the function, predict the result, then disable the experimental line and compare. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. A browser that rejects the experimental declaration can keep #b45309. The contrast follows from this rule: Retain an ordinary supported declaration before an experimental first-valid() declaration so non-supporting browsers have a complete fallback. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for progressive enhancement outside the function, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain progressive enhancement outside the function, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Computed-value timing · Full contents · Next: DevTools diagnosis →
CHAPTER 18 OF 20 · Back to contents
18. DevTools diagnosis
The short answer: DevTools diagnosis is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the devtools diagnosis example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
.card{--accent:20px;color:#b45309;color:first-valid(var(--accent),#b45309)}
Expected result and reasoning. DevTools evidence can separate unsupported syntax, invalid substitution and a later overriding rule. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. A screenshot cannot reveal why a value won. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Which declaration is crossed out, invalid or computed?”
- Evidence to collect: the exact input, environment version, observed result and the rule for devtools diagnosis
- Variable to hold constant: the surrounding setup, so the comparison isolates devtools diagnosis.
- Variable to change: add a later rule deliberately and trace the cascade
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For devtools diagnosis, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a celebration page. Transfer devtools diagnosis into a celebration page. Preserve the governing rule—Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.—while identifying what changes in this setting. DevTools diagnosis is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a classroom demo. Transfer devtools diagnosis into a classroom demo. Preserve the governing rule—Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.—while identifying what changes in this setting. DevTools diagnosis is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a design-token layer. Transfer devtools diagnosis into a design-token layer. Preserve the governing rule—Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.—while identifying what changes in this setting. DevTools diagnosis is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a progressive-enhancement review. Transfer devtools diagnosis into a progressive-enhancement review. Preserve the governing rule—Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.—while identifying what changes in this setting. DevTools diagnosis is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for devtools diagnosis, predict the result, then add a later rule deliberately and trace the cascade. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. DevTools evidence can separate unsupported syntax, invalid substitution and a later overriding rule. The contrast follows from this rule: Inspect the winning declaration, substituted custom-property value and computed property rather than inferring support from appearance alone. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for devtools diagnosis, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain devtools diagnosis, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Progressive enhancement outside the function · Full contents · Next: Draft status and target browsers →
CHAPTER 19 OF 20 · Back to contents
19. Draft status and target browsers
The short answer: Draft status and target browsers is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the draft status and target browsers example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
const supported=CSS.supports('color','first-valid(red, blue)');
console.log(supported);
Expected result and reasoning. The Boolean is environment-specific and must be recorded with browser version. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. A draft specification or one passing browser is not a universal support guarantee. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “Which browser versions are actually supported by the project?”
- Evidence to collect: the exact input, environment version, observed result and the rule for draft status and target browsers
- Variable to hold constant: the surrounding setup, so the comparison isolates draft status and target browsers.
- Variable to change: record the result across the target matrix
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For draft status and target browsers, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a component library. Transfer draft status and target browsers into a component library. Preserve the governing rule—first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.—while identifying what changes in this setting. Draft status and target browsers is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a browser-support test. Transfer draft status and target browsers into a browser-support test. Preserve the governing rule—first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.—while identifying what changes in this setting. Draft status and target browsers is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a visual regression fixture. Transfer draft status and target browsers into a visual regression fixture. Preserve the governing rule—first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.—while identifying what changes in this setting. Draft status and target browsers is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a card gallery. Transfer draft status and target browsers into a card gallery. Preserve the governing rule—first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.—while identifying what changes in this setting. Draft status and target browsers is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for draft status and target browsers, predict the result, then record the result across the target matrix. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. The Boolean is environment-specific and must be recorded with browser version. The contrast follows from this rule: first-valid() is specified in CSS Values and Units Level 5 as an exploratory draft feature; support must be tested in declared targets. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for draft status and target browsers, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain draft status and target browsers, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: DevTools diagnosis · Full contents · Next: Choosing the right fallback tool →
CHAPTER 20 OF 20 · Back to contents
20. Choosing the right fallback tool
The short answer: Choosing the right fallback tool is a decision about the feature’s documented contract, not a cue to copy a longer snippet. The governing rule is: Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.. This is the sentence a learner should be able to say before touching a keyboard. It turns a vague topic into a testable model and gives a parent or tutor something precise to listen for.
The platform applies the rule “Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.”. A minimal fixture makes the relevant input and observation visible while keeping unrelated project state out of the explanation. That mechanism matters because superficially similar examples can produce different results. A reliable explanation names the relevant object, identifies the operation performed on it, and states when the decision is made. “It works” is not enough; mastery means predicting the result and explaining why a nearby example behaves differently.
Worked example: predict before running
Read the choosing the right fallback tool example once without executing it. Mark the exact input, the operation under study, and the expected observable result. Then write a one-sentence prediction. Only after that should the learner run the example. This order separates understanding from trial-and-error and makes any surprise diagnostically useful.
/* Choose after identifying evaluation stage. */
color:#444;
color:var(--accent,#444);
Expected result and reasoning. The simplest tool is the one whose failure timing matches the problem. The important evidence is not merely the printed value or exit status. It is the connection between that evidence and the rule above. Say the chain aloud: input → relevant rule → operation → observable result. If a learner cannot supply the middle two links, the right response is to revisit the model rather than add more examples.
Near miss. Selecting the newest syntax first can complicate a problem already solved by established CSS. This is tempting because it uses a familiar word or visual resemblance. Correct it by changing only one variable at a time and comparing the two cases side by side. A good contrast preserves everything except the feature named in the rule.
Diagnostic route when the answer is wrong
Use a four-pass diagnosis. Pass one: classify. Identify the kind of value or state being examined. Pass two: trace. Follow the operation in the order defined by the platform or specification. Pass three: observe. Capture a minimal output, not a screenshot of a large project. Pass four: contrast. Change one feature and run again. For this chapter, the highest-value question is: “What exact failure and evaluation stage require fallback?”
- Evidence to collect: the exact input, environment version, observed result and the rule for choosing the right fallback tool
- Variable to hold constant: the surrounding setup, so the comparison isolates choosing the right fallback tool.
- Variable to change: write the decision in one sentence before coding
- Explanation standard: name the rule, not merely the successful command or copied syntax.
For choosing the right fallback tool, a common unproductive move is to make several changes at once. That can make the symptom disappear while leaving the misconception intact. Reset to the smallest example, keep a brief prediction log, and preserve both the successful and unsuccessful case. The pair becomes a reusable test fixture and a much clearer revision note than a paragraph of definitions.
Four transfer cases
Transfer case 1: a classroom demo. Transfer choosing the right fallback tool into a classroom demo. Preserve the governing rule—Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.—while identifying what changes in this setting. Choosing the right fallback tool is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 2: a design-token layer. Transfer choosing the right fallback tool into a design-token layer. Preserve the governing rule—Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.—while identifying what changes in this setting. Choosing the right fallback tool is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 3: a progressive-enhancement review. Transfer choosing the right fallback tool into a progressive-enhancement review. Preserve the governing rule—Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.—while identifying what changes in this setting. Choosing the right fallback tool is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Transfer case 4: a celebration page. Transfer choosing the right fallback tool into a celebration page. Preserve the governing rule—Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.—while identifying what changes in this setting. Choosing the right fallback tool is a decision about the feature’s documented contract, not a cue to copy a longer snippet. Record the input, prediction, observation and version so a disagreement becomes a diagnosable case rather than a guess. Start by naming the observable evidence, then apply the chapter rule “Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job.”. Do not jump straight to a command or syntax change. First predict the outcome, perform the smallest safe check, and compare the result with that prediction. This makes the case useful beyond the immediate exercise: the learner is practising a decision process, not memorising a one-off answer. If the result differs, record what changed—platform, input shape, repository state, document tree, or evaluation order—before revising the model.
Practice, pause point, and explained answer
Task. Rebuild the example for choosing the right fallback tool, predict the result, then write the decision in one sentence before coding. Explain both outcomes without trial and error. Before checking anything, write (1) the predicted result, (2) the rule that justifies it, and (3) one nearby variation that should change the result. A complete response should be understandable to someone who has not seen the example.
Explained answer. The simplest tool is the one whose failure timing matches the problem. The contrast follows from this rule: Use repeated declarations for parse-time fallback, @supports for conditional rule groups, var() for missing custom properties and first-valid() only for its supported whole-value job. The reasoning earns more attention than the final value. If the learner reached the correct result by guessing, repeat the task with the variation they proposed. If they can predict both cases and explain the contrast, the idea is beginning to transfer.
Parent and tutor decision point
Ask the learner to name the evidence that matters for choosing the right fallback tool, then request one controlled variation. A correct value without a causal explanation is not yet mastery. A useful conversation is brief: ask for the rule, ask for a prediction, then ask which observation would disprove it. Avoid turning the exchange into a vocabulary quiz. The goal is to hear a causal explanation and see a controlled test. Praise a corrected prediction when the learner uses evidence well; that is stronger progress than protecting an unexamined first answer.
Ready to move on? Move forward when the learner can explain choosing the right fallback tool, solve the worked case without prompts, and handle at least two transfer cases with a changed context. Revisit this chapter when the explanation relies on “usually”, “looks like”, or “the computer says so” without identifying the governing rule.
← Previous: Draft status and target browsers · Full contents · Parent guide →
Parent guide: what mastery looks like
A learner has not mastered CSS first-valid() merely because one polished example runs. Look for four behaviours: they can state the rule in plain language; predict before executing; isolate one changed condition; and explain why a transfer case is the same problem or a different one. Those behaviours make progress visible without requiring a parent to become a specialist.
Use a ten-minute check-in. Ask the learner to choose one chapter, reconstruct its example from memory, and narrate the causal chain. Then change one input. If the learner can update the prediction and justify the change, stop. More repetitions are not automatically better. Save the two-case pair and return to it after a few days.
If every answer is hesitant, reduce the scope. Return to the earliest chapter whose rule cannot be stated accurately. If explanations are fluent but real tasks still fail, move to a capstone because the missing skill is likely transfer or diagnosis. If frustration rises, separate typing errors from conceptual errors and solve only one category in that session.
Capstone practice with explained routes
Capstone 1: Rebuild the smallest trustworthy fixture
Scenario. Create a disposable CSS fixture that demonstrates late-validity whole-value fallback without unrelated project code.
Route. Record environment, input, prediction and output. Keep one nearby contrast. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. The fixture succeeds when another learner can reproduce the observation and explain the rule separating the two cases. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 2: Diagnose a believable wrong explanation
Scenario. A learner has the correct output but explains it with the wrong mechanism.
Route. Change the one condition the wrong explanation says matters while holding the real governing condition constant. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. The controlled contrast exposes the misconception without turning the task into guesswork. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 3: Handle a version boundary
Scenario. Two environments produce different observations.
Route. Capture versions, platform or browser, exact input and relevant state before comparing. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. A difference is not automatically an error; bind the claim to the documented environment and retest. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 4: Design a parent check-in
Scenario. A parent has ten minutes and no specialist background.
Route. Ask for one rule, one prediction, one run and one changed condition. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. The learner demonstrates mastery through a causal explanation and evidence-based revision. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 5: Transfer into a larger project
Scenario. The isolated fixture works but a school or home project does not.
Route. Preserve the fixture, then compare project inputs and dependencies one at a time. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. The first dependency that changes the result becomes the next diagnostic focus; the verified rule remains the baseline. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 6: Write a regression check
Scenario. The behaviour must remain understood after an update.
Route. Save the smallest positive case, the near miss and version metadata. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. A useful check reports a meaningful changed observation and points back to the governing rule. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 7: Explain a limitation honestly
Scenario. The selected feature does not cover an important job or is not universally available.
Route. Name the limitation, show what evidence the feature provides and identify the safer route. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. Good advice is bounded; it neither discards a useful tool nor stretches it into a guarantee. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Capstone 8: Choose the right tool
Scenario. Several related methods or commands appear to solve the same task.
Route. Define desired output, evaluation timing, compatibility and acceptable failure modes. Begin with a written prediction, collect the smallest sufficient evidence, and explain which observation would make you revise the conclusion.
Explained resolution. Select the contract that matches the job and state why at least one tempting alternative was rejected. A strong submission includes the result, the causal chain and a controlled contrasting case. It does not hide uncertainty: if platform, version or environment matters, state that boundary.
Frequently asked questions
Is CSS first-valid() mainly a syntax topic?
No. Syntax is the handle. Mastery means stating the contract, predicting a boundary case, collecting the right evidence and choosing a different tool when the contract does not fit.
How long should one practice session be?
Ten to twenty focused minutes is enough for one rule, one worked example, one near miss and one explanation. Stop when the learner can explain the contrast, then preserve the fixture for later retrieval.
Should every edge case be memorised?
No. Memorise the central rule and organise edge cases by cause: version, platform, input shape, browser support or repository state. Keep the primary source beside the fixture.
What can a non-specialist parent ask?
Ask for a prediction, the rule behind it, the observation that could disprove it and one changed case. Those questions reveal understanding without requiring the parent to know the final value.
When is copying an example useful?
Copying establishes a trusted baseline. It becomes learning after the student predicts the result, reconstructs the example, changes one condition and explains the changed outcome.
How do we separate setup errors from concept errors?
Run a known-good minimal fixture first. If it fails, inspect version, support and transcription. If it passes but a controlled variation is predicted incorrectly, the misconception is conceptual.
Should practice start inside a large project?
Not initially. Begin in a disposable directory, tiny script or isolated page. Transfer the verified rule only after the smallest case is understood.
What belongs in revision notes?
Keep the rule in one sentence, the smallest successful example, a near miss, observed output, environment version and one diagnostic question.
What if two computers disagree?
Treat the difference as evidence. Record versions, exact input and relevant state, then consult the versioned primary source before deciding that either observation is wrong.
When should the learner move on?
Move on when the learner can explain the rule, predict two contrasts, diagnose a deliberately broken case and transfer the idea without step-by-step prompting.
References and verification notes
Primary technical source: CSS Values and Units Level 5 draft. The CSS Working Group draft describes first-valid() as a whole-value, comma-separated fallback function motivated by late substitution; the first supported valid candidate wins, and no valid candidate makes the property invalid at computed-value time. The draft itself marks the feature as exploratory.
The worked examples were checked with Static verification against the CSS Values and Units Level 5 algorithm and target-browser feature-detection fixtures; examples retain an ordinary declaration for browsers without first-valid() support. The checks confirm the specific examples in this guide; they do not promise identical behaviour on an older version, a different operating system, a different browser implementation, or a repository with different state. Keep the version and environment with the saved fixture.
Last reviewed: 17 October 2026. This article is educational guidance for families and learners. It does not advertise a physical Punggol outlet or make admissions, affiliation, score or outcome guarantees.

