Button styling update for consistent buttons (#24483)

* Updating button changes

* Updating button

* Updating invite modal button

* Updating button changes

* Updating button

* Updating buttons

* Updating buttons

* Updating buttons

* Updating back btn

* Updating various buttons

* Updating tests

* Updating test

* Reverting channel icon

* Update channel_profile.tsx

* Update setting_picture.tsx

* Updating tests

* Update group_member_list.test.tsx.snap

* Update user_group_popover.test.tsx.snap

* Update user_group_popover.test.tsx.snap

* Updating tests and adding btn class

* Adding btn-xs class

* Updating tests

* Updating test

* Updating test file

* Updating test

* Updating changes requested by daniel

* Updating test

* Updating based on harrisons feedback

* Updating buttons

* Updating test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Asaad Mahmood
2023-09-25 15:17:14 +05:00
коммит произвёл GitHub
родитель 6c48cca78f
Коммит 6f4382189f
183 изменённых файлов: 722 добавлений и 1102 удалений

Просмотреть файл

@@ -1,5 +1,26 @@
@charset 'UTF-8';
.style--none {
padding: 0;
border: none;
background: transparent;
&:focus {
outline: 0;
text-decoration: none;
}
&.btn--block {
width: 100%;
text-align: left;
}
&:hover,
&:active {
text-decoration: none;
}
}
button {
.unread-badge {
display: inline-block;
@@ -9,49 +30,221 @@ button {
background: #f74343;
border-radius: 50%;
}
&.style--none {
padding: 0;
border: none;
background: transparent;
&:focus {
outline: 0;
text-decoration: none;
}
&.btn {
padding: 6px 12px;
}
&.btn--block {
width: 100%;
text-align: left;
}
&:hover,
&:active {
text-decoration: none;
}
}
}
.btn {
border-radius: $border-rad;
// Important is given to override bootstrap styles on different states
display: inline-flex;
height: 40px;
align-items: center;
justify-content: center;
padding: 0 20px;
border: none;
border-radius: $border-rad * 2;
font-size: 14px;
font-weight: 600;
gap: 8px;
outline: none !important;
transition: all 0.15s ease;
&.btn-primary {
border-color: transparent;
background: $primary-color;
&.btn-icon {
width: 40px;
padding: 0;
background-color: transparent;
color: rgba(var(--center-channel-color-rgb), 0.56);
font-size: 24px;
&:hover {
background-color: rgba(var(--center-channel-color-rgb), 0.08);
color: rgba(var(--center-channel-color-rgb), 0.72);
}
&:hover,
&:focus,
&:active {
background: $primary-color--hover;
background-color: rgba(var(--button-bg-rgb), 0.08);
color: rgba(var(--button-bg-rgb), 1);
}
i {
font-size: inherit;
}
&.btn-xs {
width: 24px;
height: 24px;
font-size: 14.4px;
&.btn-compact {
width: 20px;
height: 20px;
}
}
&.btn-sm {
width: 32px;
height: 32px;
font-size: 18px;
&.btn-compact {
width: 28px;
height: 28px;
}
}
&.btn-lg {
width: 48px;
height: 48px;
font-size: 31.2px;
&.btn-compact {
width: 36px;
height: 36px;
}
}
}
&:not(.a11y--active) {
box-shadow: none;
}
&:active {
box-shadow: none;
}
& + .btn {
margin-left: 8px !important;
}
&.btn-full {
width: 100%;
}
i {
display: inline-flex;
width: 18px;
height: 18px;
align-items: center;
justify-content: center;
margin-right: 0;
}
&.btn-xs {
height: 28px;
}
&.btn-sm {
height: 32px;
padding: 0 16px;
font-size: 12px;
gap: 6px;
}
&.btn-lg {
height: 48px;
padding: 0 24px;
font-size: 16px;
gap: 10px;
.i {
width: 20px;
height: 20px;
font-size: 24px;
}
}
&.btn-primary {
position: relative;
border-color: transparent;
background-color: rgb(var(--button-bg-rgb));
// These hover and active values are for things outside the app__body, the correct theme styles for the primary button are applied in utils.jsx
&:hover {
background-color: #1a51c8;
}
&:active {
background-color: #184ab6;
}
&:disabled,
&:disabled:hover,
&:disabled:active {
background: rgba(var(--center-channel-color-rgb), 0.08);
color: rgba(var(--center-channel-color-rgb), 0.32);
opacity: 1;
}
}
&.btn-secondary {
border: 1px solid rgb(var(--button-bg-rgb));
background: transparent;
color: rgb(var(--button-bg-rgb));
&.btn-danger {
border-color: currentColor;
background: transparent;
color: var(--error-text);
&:hover {
border-color: currentColor;
background-color: rgba(var(--error-text-color-rgb), 0.08);
color: var(--error-text);
}
&:active,
&:focus {
border-color: currentColor;
background-color: rgba(var(--error-text-color-rgb), 0.16);
color: var(--error-text);
}
}
&:hover {
background-color: rgb(var(--button-bg-rgb), 0.08);
}
&:active {
background-color: rgb(var(--button-bg-rgb), 0.16);
}
}
&.btn-tertiary {
background: rgba(var(--button-bg-rgb), 0.08);
color: rgb(var(--button-bg-rgb));
&:hover {
background-color: rgb(var(--button-bg-rgb), 0.12);
}
&:active {
background-color: rgb(var(--button-bg-rgb), 0.16);
outline: none;
}
&:disabled,
&:disabled:hover,
&:disabled:active {
background: rgba(var(--center-channel-color-rgb), 0.08);
color: rgba(var(--center-channel-color-rgb), 0.32);
opacity: 1;
}
}
&.btn-quaternary {
background: transparent;
color: rgb(var(--button-bg-rgb));
&:hover {
background: rgba(var(--button-bg-rgb), 0.08);
}
&:active {
background-color: rgb(var(--button-bg-rgb), 0.12);
}
}
&.btn-danger {
background: var(--error-text);
color: $white;
.app__body & {
@@ -94,41 +287,8 @@ button {
margin-left: 6px;
}
}
&.btn-link {
&:active,
&:focus {
outline: none;
}
}
}
%btn-transition {
transition: all 0.15s ease;
}
.btn-icon {
width: 3.2rem;
height: 3.2rem;
padding: 0;
border: none;
background: transparent;
border-radius: 4px;
color: rgba(var(--center-channel-color-rgb), 0.56);
fill: rgba(var(--center-channel-color-rgb), 0.56);
font-size: 1.6rem;
&:hover {
background: rgba(var(--center-channel-color-rgb), 0.08);
color: rgba(var(--center-channel-color-rgb), 0.72);
fill: rgba(var(--center-channel-color-rgb), 0.72);
}
&:active,
&--active,
&--active:hover {
background: rgba(var(--button-bg-rgb), 0.08);
color: v(button-bg);
fill: v(button-bg);
}
}

Просмотреть файл

@@ -66,14 +66,6 @@
text-align: right;
}
.btn-primary {
height: 40px;
padding: 0 36px;
border-radius: 4px;
font-size: 14px;
font-weight: 600;
}
.no-channel-message {
padding: 1rem;
font-size: 1.4rem;
@@ -188,19 +180,6 @@
.multi-select__footer {
order: 2;
margin-top: 10px;
.btn-cancel {
@include tertiary-button;
width: auto;
height: 40px;
margin-right: 10px;
}
.save-button {
width: 67px;
padding: 0;
}
}
.custom-no-options-message {

Просмотреть файл

@@ -161,7 +161,7 @@
border-top: solid 1px rgba(0, 0, 0, 0.1);
background: $white;
.btn-link {
.btn-tertiary {
color: $dark-gray;
&.disabled {
@@ -430,7 +430,7 @@
border-top: 0;
}
.btn-link {
.btn-tertiary {
color: $dark-gray;
&.disabled {

Просмотреть файл

@@ -166,10 +166,6 @@
padding: 12px 30px 12px 15px;
}
.btn {
font-size: 13px;
}
.info__label {
margin-bottom: 3px;
font-size: 0.9em;
@@ -312,17 +308,6 @@
line-height: 10px;
}
}
.btn {
&.btn-primary {
position: relative;
margin-top: -4px;
i {
margin-right: 5px;
}
}
}
}
.no-channel-message {
@@ -1187,22 +1172,29 @@
button.modal-header-back-button {
position: absolute;
left: 18px;
display: flex;
width: 4rem;
height: 4rem;
align-items: center;
justify-content: center;
border: none;
background: transparent;
border-radius: 4px;
color: rgba(var(--center-channel-color-rgb), 0.56);
float: left;
&:hover {
background-color: rgba(var(--center-channel-color-rgb), 0.08);
color: rgba(var(--center-channel-color-rgb), 0.72);
}
&:active {
background-color: rgba(var(--center-channel-color-rgb), 0.12);
background-color: rgba(var(--button-bg-rgb), 0.08);
color: var(--button-bg);
}
i {
display: inline;
font-size: 24px;
line-height: 24px;
}

Просмотреть файл

@@ -150,8 +150,6 @@
}
.sidebar--right__expand {
margin: 0 4px 0 0;
i {
top: 0;
}
@@ -236,6 +234,7 @@
white-space: nowrap;
.btn-icon {
margin: 0 !important;
font-size: 20px;
}
@@ -243,6 +242,7 @@
display: flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
}
}

Просмотреть файл

@@ -912,7 +912,7 @@
margin: 1em 0 0.3em;
margin-top: 1em;
.btn-link {
.btn-tertiary {
&.danger {
color: #c55151;
}

Просмотреть файл

@@ -123,40 +123,6 @@
}
}
.get-app__download {
border: none !important;
background-color: #145dbf !important;
&:hover {
background-color: #145dbf !important;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1), 0 2px 10px 0 rgba(0, 0, 0, 0.1);
}
&:active,
&:focus {
background-color: #1151a6 !important;
}
}
.get-app__continue {
border-color: #145dbf !important;
color: #145dbf !important;
&:hover {
background-color: rgba(255, 255, 255, 0.1) !important;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1), 0 2px 10px 0 rgba(0, 0, 0, 0.1);
}
&:active {
background-color: rgba(20, 93, 191, 0.1) !important;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1), 0 2px 10px 0 rgba(0, 0, 0, 0.1);
}
&:focus {
background-color: rgba(20, 93, 191, 0.1) !important;
}
}
.get-app__preference {
display: flex;
margin-top: 23px;

Просмотреть файл

@@ -401,12 +401,6 @@
}
}
.copy-theme-button {
padding: 5px 8px;
border: 1px solid v(link-color);
text-decoration: none;
}
.copy-theme-success {
height: 30px;
padding: 5px 12px;
@@ -584,10 +578,6 @@
font-weight: 500;
}
.sel-btn {
margin-right: 5px;
}
.member-div {
position: relative;
width: 100%;

Просмотреть файл

@@ -272,166 +272,6 @@ body {
margin-bottom: 0;
}
.btn {
padding: em(7px) em(15px);
margin-right: 5px;
font-size: 1em;
font-weight: 600;
.fa {
position: relative;
top: 1px;
margin: 0;
font-size: 17px;
&:last-child {
margin-left: 8px;
}
&:first-child {
margin-right: 8px;
}
&.fa--margin-top {
position: relative;
top: 1px;
}
&.fa-check,
&.fa-refresh {
left: -2px;
margin-right: 0.5em;
font-size: 0.9em;
}
}
.icon {
position: relative;
display: inline-block;
width: 18px;
height: 18px;
margin-right: 12px;
background-size: 100% 100%;
text-align: center;
}
&.btn-custom-login {
display: flex;
width: 200px;
min-width: 200px;
height: 40px;
align-items: center;
padding: 0 24px;
margin: 1em 0;
border-radius: 2px;
color: $white;
text-align: left;
> span {
position: relative;
display: flex;
align-items: center;
> span {
line-height: normal;
}
}
&.gitlab {
background: #548;
&:hover {
background: darken(#548, 10%);
}
.icon {
background-image: url('../images/gitlabLogo.png');
}
}
&.google {
background: #dd4b39;
&:hover {
background: darken(#dd4b39, 10%);
}
.icon {
background-image: url('../images/googleLogo.png');
}
}
&.office365 {
background: #0079d6;
&:hover {
background: darken(#0079d6, 10%);
}
.icon {
background-image: url('../images/office365Logo.png');
}
}
&.openid {
background: #0079d6;
white-space: normal;
&:hover {
background: darken(#0079d6, 10%);
}
> span {
> span {
overflow: hidden;
width: 150px;
line-height: normal;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
&.ldap {
background: #3aa1cf;
&:hover {
background: darken(#3aa1cf, 10%);
}
}
&.email {
background: $primary-color;
&:hover {
background: $primary-color--hover;
}
}
&.saml {
background: #34a28b;
&:hover {
background: darken(#34a28b, 10%);
}
}
&.btn--full {
width: 100%;
max-width: 350px;
text-align: left;
}
&.btn--large {
width: 300px;
}
}
&.btn-default {
color: #444;
}
}
.has-error {
&.no-padding {
padding: 0;