Utilities map configuration functions
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 175k
- Forks
- 78.6k
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 35
Description
Prerequisites
- I have searched for duplicate or closed feature requests
- I have read the contributing guidelines
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 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documented $utilities API in the Bootstrap utilities documentation and compare its low-level map-merge usage with the proposed operations. Review the existing Sass utilities configuration and determine how mixins or functions should add, replace, remove, and update utility options. Done means the supported operations are exposed through a clear API and documented with usage examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scss
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100