Improve style of button with single icon without text (#5952)

This commit is contained in:
Yuriy Bakhtin 2022-11-29 18:27:38 +04:00 committed by GitHub
parent f685548885
commit 418812dbed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,7 @@
/** /**
* This file is generated by the "yii asset" command. * This file is generated by the "yii asset" command.
* DO NOT MODIFY THIS FILE DIRECTLY. * DO NOT MODIFY THIS FILE DIRECTLY.
* @version 2022-11-29 11:02:20 * @version 2022-11-29 14:04:39
*/ */
return [ return [
'app' => [ 'app' => [

View File

@ -227,6 +227,10 @@ class Button extends BootstrapComponent
$this->htmlOptions['data-action-method'] = $method; $this->htmlOptions['data-action-method'] = $method;
} }
if ($this->text === null && $this->_icon !== null) {
$this->htmlOptions['class'] .= ' btn-icon-only';
}
if ($this->_link) { if ($this->_link) {
$href = isset($this->htmlOptions['href']) ? $this->htmlOptions['href'] : null; $href = isset($this->htmlOptions['href']) ? $this->htmlOptions['href'] : null;
return Html::a($this->getText(), $href, $this->htmlOptions); return Html::a($this->getText(), $href, $this->htmlOptions);

View File

@ -15,10 +15,12 @@
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
padding: 8px 16px; padding: 8px 16px;
i { &:not(.btn-icon-only) {
i.fa {
margin-right: 4px; margin-right: 4px;
} }
} }
}
.input.btn { .input.btn {
outline: none; outline: none;

File diff suppressed because one or more lines are too long