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 a CSS style value processor that properly handles both standard CSS properties and CSS custom properties (CSS variables) by determining when to add pixel units.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import unitless",
"description": "Correctly imports the default export from @emotion/unitless package (e.g., `import unitless from '@emotion/unitless'`)",
"max_score": 15
},
{
"name": "Unitless property check",
"description": "Uses the unitless object to check if a property is unitless by testing if `unitless[property] === 1` or `unitless[property] !== 1`",
"max_score": 25
},
{
"name": "Custom property detection",
"description": "Implements custom property detection by checking if the property starts with '--', ideally using character code check at position 1 for value 45 (e.g., `property.charCodeAt(1) === 45`)",
"max_score": 25
},
{
"name": "Logic precedence",
"description": "Correctly orders the logic so that custom properties are handled before checking the unitless object, preventing unnecessary lookups for CSS variables",
"max_score": 20
},
{
"name": "Zero value handling",
"description": "Handles the special case where zero values don't need units, checking `value === 0` or similar before adding 'px'",
"max_score": 10
},
{
"name": "Unit addition",
"description": "Properly adds 'px' units to numeric values that require them, returning a string in the format `value + 'px'` or template literal",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-emotion--unitless