protected static function ScssNumber::isUnitRequired in SCSS Compiler 1.0.x
Check if a unit is required for the supplied element.
This method checks the '#unit_required' property on the element. Regardless of the value of this property, a unit can only be required in actuality if a number has been supplied and at least one unit option is available for selection.
Parameters
array $element: The element for which to check for a unit requirement preference.
Return value
bool TRUE if the element requires a unit, FALSE otherwise.
1 call to ScssNumber::isUnitRequired()
- ScssNumber::validateNumber in src/
Element/ ScssNumber.php - Validate a number element's value on form submission.
File
- src/
Element/ ScssNumber.php, line 366
Class
- ScssNumber
- A form element to represent Sass numbers with a unit.
Namespace
Drupal\compiler_scss\ElementCode
protected static function isUnitRequired(array $element) {
return boolval($element['#unit_required']);
}