[UI v2] experiment: Adds basic spacing utilities as props and new layout components: Block and Flex #16249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Laying out components with raw tailwwind is hard. There are too many options and tailwind classes to pass to simply lay components out. For example, when will I ever use
mt-4.5
?This PR experiments in:
css
classes usingCVA
to be able to pass layout properties as props. These props helps reduce the number of spacing options for the UI so that developers can think less and simplify spacing.TLDR this PR limits these tailwind properties, provides them as props (which _can _ be added in our base components if needed), and adds
<Block />
and<Flex />
components to make laying out components more declarative and reduce decision fatigue on what spacing levels to pass<Block />
and<Flex />
component that can be used to lay components out using the reduced options mentioned above.Example
The example ☝️ creates a bit more declarative way of laying components out.
Another example
Checklist
<link to issue>
"mint.json
.Related to #15512