-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(css): fp-1791 button auto width & django cms form button tweak #560
Conversation
- Add `[type="submit"]` because not every button is primary. - Add `.form-button` because it should appear in a search.
60aa4f9
to
f27c67b
Compare
Previous image was missing commit that loaded fix from core-styles. TACC/Core-CMS#560
Cuz #531 did not test button size.
TACC/Core-Styles@98cdc10 This APCD testing on #560 did NOT use this, BUT that is okay, BEACUSE this code change would not affect render. CMS sets button font size explicitely (i.e. overrides this removed code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes for reviewers.
.button-wrapper button { | ||
.form-button, | ||
.button-wrapper button[type="submit"] { | ||
@extend .c-button; | ||
@extend .c-button--primary; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation. More specific selectors. (Judge my logic, please.)
Background. I want TACC form component classes, but APCD switched to manual forms faster than I could create styles for them, so we are re-using Django CMS form plugin classes.
Reasons.
I assume1 devs will:
- use
.form-button
for submit button, with or without.button-wrapper
, so style as primary. - use
.button-wrapper
for one or more buttons, so only a submit button should be primary.
Footnotes
-
I should document2 these instead of assume usage. Even if I make TACC form component, these styles still exist for Django CMS form plugin forms. ↩
-
So far, the documentation I have is CMS form creation guides. I could document Django CMS form styles during FP-1828. ↩
font-size: var(--global-font-size--medium); | ||
font-size: var(--global-font-size--small); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation. I had guessed the wrong font size when I first set up these untested CMS-specific c-button
styles. [It had been untested], even though CMS has buttons, because the first CMS button was not a .c-button
, it was a Django CMS form1 button2.
Footnotes
-
taccsite_cms/static/site_cms/css/src/_imports/components/django.cms.forms.css
↩ -
The first
c-button
came when "+ Add …" and "– Remove" buttons were added to APCD "Request to Submit" form. ↩
"@tacc/core-styles": "^0.9.0", | ||
"@tacc/core-styles": "github:TACC/Core-Styles#fix/fp-1791-automatic-button-width", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, LGTM
Overview
Related
Changes
[type="submit"]
because not every button is primary..form-button
because it should appear in a search.Testing
Pages:
Steps:
UI
code commented out