bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Add functions and mixins to manipulate the utlities map

Open romaricpascal opened this issue 1 year ago • 0 comments

Re-opening of #35977 after accidentally closing it on my repo (sorry again for that). @mdo, I hope I didn't lose any of your edits in the process as I've also rebased main to fix conflicts in the docs.

As a reminder of what it was about:

Code for #35945. Just threw some code in to get the shapes of the functions. Still need testing, handling all the cases (values not being maps for example), and docs updates (but I'll do that last once the code is set).

The PR adds the following:

  1. functions to get options, a specific option or a specific value for a given utility: a. utilities-get-options b. utilities-get-option c. utilities-get-value
  2. mixins to set options (in bulk or a specific one), new values or remove values for a given utility: a. utilities-set-options (defaults to merging with existing, but can be used to completely override by passing $merge: false, allowing to completely redefine a utility if necessary) b. utilities-set-option (just a thin wrapper on utilities-set-options) c. utilities-add-values d. utilities-remove-values
  3. mixins to add or remove utilities (they don't do as much as the rest, but provide consistency) a. utilities-add b. utilities-remove

Please let me know if there'd be one I missed, or if some are too much (2.b, 3.a. and 3.b for example only bring a consistent API by thinly wrapping other existing functions/mixins)

romaricpascal avatar Sep 09 '22 11:09 romaricpascal