Open occupant opened 5 years ago
Feature Review Checklist:
Check above and leave comment below for each review.
Info: https://github.com/UBCCM/guides/tree/master/html
... Code sample (i.e. CodePen)
... Detail of review and tests
Info: https://github.com/UBCCM/guides/tree/master/css
... Code sample (i.e. CodePen)
... Detail of review and tests
Info: https://github.com/UBCCM/guides/tree/master/javascript
... Code sample (i.e. CodePen)
... Detail of review and tests
... Description of the expected behaviour
... Detail of review and tests
... Description of the expected user experience, UX tests results, expected interactions, etc.
... Detail of review and tests. verification animations or interactions to be consistent with others
... Screenshot, design system?
... Detail of review and tests
... For components, start with markup testing on https://achecker.ca/checker/index.php ... WCAG AAA for brand elements, WCAG AA for everything else
... Accessibility test results
... Link to Documentation, focus on developer documentation.
Problem description
The current design spec defines a series of button styles and ways to extend. We need to define, code and document the method for adding these consistently with a variety of markup (ie.
a
,button
,p
,div
tags).Button style link styles
Inline CTA link styles
CTA link styles
Text link styles
When adding icons within / before / after buttons or links, we additionally need to decide if these are inline elements (ie. an svg, which would allow any image to be added) or a set of background image elements (meaning we will have a limited set of icons that will be managed and included with CSS).
Proposed solution
In an initial attempt to replicate these styles, I have taken the approach of constructing these styles with an additive approach. For example, to produce this:
Instead of single class to output all required styling:
.unit-button--blue-w-envelope-separator
I've used a series of classes that can be combined as required:
.unit-button unit-button--light unit-button--has-icon-right unit-button--has-separator-right
and an inline svg for the envelope.eg.
<a href="#" class="unit-button unit-button--has-icon-right unit-button--animate-icon unit-button--light">Unit button: light <svg role="presentation" class="unit-button__icon" viewBox="0 0 64 64"><use xlink:href="#icon-arrow-circle"></use> </svg></a>
<button class="unit-button unit-button--has-icon-right unit-button--animate-icon unit-button--light">Unit button: light <svg role="presentation" class="unit-button__icon" viewBox="0 0 64 64"> <use xlink:href="#icon-arrow-circle"></use> </svg></button>
We could provide a few classes to simplify common use cases (a button with an arrow on the right) as a compromise between simplicity and flexibility.
Additional context
Example css can be found here. Example markup can be found here.