Prerequisites
Proposal
It'd be great if Bootstrap was providing functions or mixins to manipulate that utilities hash a bit more easily. I'm thinking something like:
utilities-add-values($utility-name, $values) for adding values to a specific utility
utilities-set-values($utility-name, $values) for replacing the values of a utility completely
utilities-remove-values($utility-name, $values) for removing targeted values of a utility
utilities-set-options($utility-name, $options) to set specific options like responsive
utilities-add($new-utility-name, $options) to add a new utility class
utilities-remove($utility-name) to completely remove a utility
I'm thinking mixins would provide the best API from a usage point of view, similarly to what sass-mq does for adding breakpoints. allowing to only do:
@include utilities-add-values(...)
instead of having to assign the result of the function each time:
$utilities: utilities-add-values(...)
Motivation and context
The API for manipulating the $utilities map is well documented, but it relies on the low level map-merge. This makes it a bit of a mouthful to write the operations, especially for adding new values to existing utilities.
Prerequisites
Proposal
It'd be great if Bootstrap was providing functions or mixins to manipulate that utilities hash a bit more easily. I'm thinking something like:
utilities-add-values($utility-name, $values)for adding values to a specific utilityutilities-set-values($utility-name, $values)for replacing the values of a utility completelyutilities-remove-values($utility-name, $values)for removing targeted values of a utilityutilities-set-options($utility-name, $options)to set specific options likeresponsiveutilities-add($new-utility-name, $options)to add a new utility classutilities-remove($utility-name)to completely remove a utilityI'm thinking mixins would provide the best API from a usage point of view, similarly to what sass-mq does for adding breakpoints. allowing to only do:
instead of having to assign the result of the function each time:
Motivation and context
The API for manipulating the
$utilitiesmap is well documented, but it relies on the low levelmap-merge. This makes it a bit of a mouthful to write the operations, especially for adding new values to existing utilities.