-
Notifications
You must be signed in to change notification settings - Fork 12
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
FRONT-2449: Button Pattern. #45
Conversation
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.
see todo in templates/overrides/form/input--submit.html.twig
this needs to be implemented.
Take notice of button attributes (primary secondary) and change according to the pattern variants.
Please add - "bcl"
under file_scan_ignore_directories
in runner.dist.yml until #61 is solved.
This would print a button which by itself that not submit the form. |
I think that if the button is of type submit then its fine, please test |
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.
I think for this task we should theme button elements also, I looked into it, to do this we can't override a template, but we can theme from scss
in _all.scss add
button.link {
display: inline;
margin: 0;
padding: 0;
cursor: pointer;
border: 0;
background: transparent;
font-size: 1em;
text-decoration: underline;
appearance: none;
}
this is needed so that the "Edit summary" button looks ok in create content form (and other forms )
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.
Looks good, but one more hurdle to pass, the functionality of other patterns was affected because the fields and options changed, please fix:
pattern-collapse.html.twig
pattern-dropdown.html.twig
pattern-modal.html.twig
pattern-popover.html.twig
I checked all and collapse was fixed, also checked different variants, greetings. |
{% if _icon %} | ||
{% set _icon = icon|merge({ | ||
path: bcl_icon_path | ||
}) %} |
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.
intendation is not correct, and there is a extra space
}) %} | |
}) %} |
{# | ||
/** | ||
* @file | ||
* Button component. |
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.
- Button pattern.
@@ -10,5 +10,13 @@ | |||
* @see template_preprocess_input() | |||
*/ | |||
#} | |||
{# @TODO Revisit after refactoring the button pattern. #} | |||
<input{{ attributes.addClass(['btn', 'btn-primary']) }} />{{ children }} | |||
{% if attributes.hasClass('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.
in the login form, the class button--primary
is not set for the login button, it seems that this class is added per use case and not automatically by a rule.
To solve this issue, we can do something like {% elseif attributes['data-drupal-selector'] == 'edit-submit' %}
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.
Ok I'm going to add it as or condition in the same if. thanks.
* Button component. | ||
*/ | ||
#} | ||
{% if _icon %} |
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.
{% if _icon %} | |
{% if icon %} |
{% set spinner = { | ||
'type': "border", | ||
'variant': "info", | ||
'small': true, |
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.
the icon is to close to the text, please add attributes: create_attribute().addClass('me-1'),
like in netlify data tab
type: text | ||
label: Assistive text | ||
description: Additional text hidden with the .visually-hidden class. | ||
preview: '' | ||
url: |
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.
url doesn't exist
@@ -18,13 +18,13 @@ | |||
label: label, | |||
style: style, |
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.
style: style, | |
variant: style, |
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.
this could be a bit confusing but ok.
af7b6de
to
66dc2f4
Compare
No description provided.