An object of CSS properties that don't accept values with units
92
Quality
Pending
Does it follow best practices?
Impact
92%
0.92xAverage score across 7 eval scenarios
{
"context": "This criteria evaluates how well the engineer uses the @emotion/unitless package to implement conditional unit addition logic for CSS property values. The focus is on proper usage of the unitless lookup object to determine when numeric values should have 'px' units appended.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Imports unitless package",
"description": "The solution correctly imports the @emotion/unitless package using either require() or import syntax",
"max_score": 10
},
{
"name": "Uses unitless object",
"description": "The solution directly references and uses the unitless object (the default export from @emotion/unitless) to check CSS properties",
"max_score": 25
},
{
"name": "Property lookup logic",
"description": "The solution checks if a property is in the unitless object using property access (unitless[property]) or similar lookup mechanism to determine if units should be added",
"max_score": 25
},
{
"name": "Conditional unit addition",
"description": "The solution adds 'px' units to numeric values only when the property is NOT in the unitless object (i.e., when unitless[property] is not 1 or is undefined)",
"max_score": 20
},
{
"name": "Handles numeric values",
"description": "The solution checks if the value is a number type and only attempts to add units to numeric values, not strings",
"max_score": 10
},
{
"name": "Zero value handling",
"description": "The solution correctly handles zero values by not adding units (returns 0 or '0' without 'px'), as zero doesn't require units in CSS",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-emotion--unitless