Buttons
- Our primary button is green:
+
+ Primary Button
- Our secondary button is blue:
-
-
-
- All button styles
-
+
+ Secondary Button
+ {theme.includes('main') ? (
+ <>
+
+
+
+ Deprecated Styles
+
+ These are being transitioned to the new secondary style above
+
+ >
+ ) : (
+ ''
+ )}
+ Our secondary button is blue or dark gray:
+
+
+
+
+
+ All button styles
+ {theme.includes('main') ? (
+ Includes styles being deprecated
+ ) : (
+ ''
+ )}
-
+ {theme.includes('main') ? (
+
+ ) : (
+ ''
+ )}
+
-
+
+ Sizes
+
+
+
+
+
+
+
+
Hyperlinks
Hyperlinks are highlighted as shown.
diff --git a/services/web/frontend/stylesheets/app/login-register.less b/services/web/frontend/stylesheets/app/login-register.less
index 307556ba51..4734e0b3f4 100644
--- a/services/web/frontend/stylesheets/app/login-register.less
+++ b/services/web/frontend/stylesheets/app/login-register.less
@@ -94,7 +94,7 @@
}
}
-.login-btn {
+.login-btn when(@is-new-css = false) {
.btn;
.btn-default;
position: relative;
@@ -102,6 +102,14 @@
padding-right: 0;
}
+.login-btn when(@is-new-css = true) {
+ .btn;
+ .btn-secondary;
+ position: relative;
+ padding-left: 20px;
+ padding-right: 0;
+}
+
.login-btn-sharelatex {
background-color: @brand-sharelatex-color;
&:focus,
diff --git a/services/web/frontend/stylesheets/components/button-groups.less b/services/web/frontend/stylesheets/components/button-groups.less
index 4cef4b6a1e..ed95d18a0c 100755
--- a/services/web/frontend/stylesheets/components/button-groups.less
+++ b/services/web/frontend/stylesheets/components/button-groups.less
@@ -120,7 +120,7 @@
// The clickable button for toggling the menu
// Remove the gradient and set the same inset shadow as the :active state
-.btn-group.open .dropdown-toggle {
+.btn-group.open .dropdown-toggle when (@is-new-css = false) {
.box-shadow(inset 0 3px 5px rgba(0, 0, 0, 0.125));
// Show no shadow for `.btn-link` since it has no other button styles.
@@ -128,6 +128,15 @@
.box-shadow(none);
}
}
+.btn-group.open .dropdown-toggle when (@is-new-css = true) {
+ &.btn-secondary {
+ background-color: @btn-secondary-hover-bg-color;
+ }
+ &.btn-primary {
+ border-color: @btn-primary-hover-bg-color;
+ background-color: @btn-primary-hover-bg-color;
+ }
+}
.btn-form-cross {
display: block;
}
diff --git a/services/web/frontend/stylesheets/components/buttons.less b/services/web/frontend/stylesheets/components/buttons.less
index 1dbaacd034..e659572d76 100755
--- a/services/web/frontend/stylesheets/components/buttons.less
+++ b/services/web/frontend/stylesheets/components/buttons.less
@@ -5,7 +5,7 @@
// Base styles
// --------------------------------------------------
-.btn {
+.btn when(@is-new-css = false) {
display: inline-block;
margin-bottom: 0; // For input.btn
font-weight: @btn-font-weight;
@@ -52,6 +52,53 @@
.box-shadow(none);
}
}
+.btn when(@is-new-css = true) {
+ display: inline-block;
+ margin-bottom: 0; // For input.btn
+ font-weight: @btn-font-weight;
+ text-align: center;
+ vertical-align: middle;
+ cursor: pointer;
+ border: @border-size solid transparent;
+ white-space: nowrap;
+ .button-size(
+ @padding-base-vertical; @padding-base-horizontal; @font-size-base;
+ @line-height-base; @btn-border-radius-base
+ );
+ .user-select(none);
+
+ &,
+ &:active,
+ &.active {
+ &:focus {
+ .tab-focus();
+ }
+ }
+
+ &:hover,
+ &:focus {
+ color: @btn-default-color;
+ text-decoration: none;
+ }
+
+ // &:active,
+ // &.active {
+ // }
+
+ &.disabled,
+ &[disabled],
+ fieldset[disabled] & {
+ &,
+ &:hover,
+ &:focus,
+ &:active,
+ &.active {
+ cursor: not-allowed;
+ opacity: 1; //needed to override deprecated styling in individual classes
+ .box-shadow(none);
+ }
+ }
+}
// Alternate buttons
// --------------------------------------------------
@@ -62,16 +109,20 @@
.btn-default-outline {
.button-outline-variant(@btn-default-bg);
}
-.btn-primary {
+.btn-primary when (@is-new-css = false) {
.button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
}
+.btn-primary when (@is-new-css = true) {
+ .btn-borderless();
+}
.btn-primary-on-primary-bg {
.button-variant(@white; @ol-dark-green; @ol-dark-green);
}
// Success appears as green
.btn-success {
- .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
+ .btn-primary;
}
+
// Info appears as blue-green
.btn-info {
.button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
@@ -84,6 +135,22 @@
.btn-danger {
.button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
}
+// btn-secondary
+.btn-secondary when(@is-new-css = false) {
+ &:not(.btn-secondary-info) {
+ .btn-default;
+ }
+}
+.btn-secondary when(@is-new-css = true) {
+ .btn-bordered();
+}
+// btn-info for old and btn-secondary for new
+.btn-secondary-info when(@is-new-css = false) {
+ .btn-info;
+}
+.btn-secondary-info when(@is-new-css = true) {
+ .btn-secondary;
+}
.reset-btns {
// reset all buttons back to their original colors
@@ -108,6 +175,9 @@
.btn-warning {
.btn-warning;
}
+ .btn-secondary {
+ .btn-secondary;
+ }
}
// Link buttons
diff --git a/services/web/frontend/stylesheets/components/theme.less b/services/web/frontend/stylesheets/components/theme.less
index 28e1914e75..bd85c49991 100755
--- a/services/web/frontend/stylesheets/components/theme.less
+++ b/services/web/frontend/stylesheets/components/theme.less
@@ -71,7 +71,7 @@
.btn-styles(@btn-primary-bg);
}
.btn-success {
- .btn-styles(@btn-success-bg);
+ .btn-styles(@btn-primary-bg);
}
.btn-info {
.btn-styles(@btn-info-bg);
diff --git a/services/web/frontend/stylesheets/core/mixins.less b/services/web/frontend/stylesheets/core/mixins.less
index 11f0ab2f44..28746e23e5 100755
--- a/services/web/frontend/stylesheets/core/mixins.less
+++ b/services/web/frontend/stylesheets/core/mixins.less
@@ -27,13 +27,16 @@
}
// WebKit-style focus
-.tab-focus() {
+.tab-focus() when (@is-new-css = false) {
// Default
outline: thin dotted;
// WebKit
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
+.tab-focus() when (@is-new-css = true) {
+ outline: none;
+}
// Center-align a block level element
.center-block() {
@@ -125,6 +128,9 @@
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
box-shadow: @shadow;
}
+.box-shadow-button-input() {
+ box-shadow: 0px 0px 0px 2px rgba(50, 101, 178, 0.56);
+}
// Transitions
.transition(@transition) {
@@ -543,6 +549,91 @@
border-radius: @btn-border-radius-base;
}
+.btn-bordered() {
+ color: @content-primary;
+ background-color: @white;
+ border-color: @border-color-base;
+
+ &:hover {
+ background-color: @btn-secondary-hover-bg-color;
+ }
+
+ &:focus {
+ color: @content-primary;
+ outline: none;
+ }
+
+ &:focus-visible,
+ &:active {
+ .box-shadow-button-input();
+ outline: none;
+ }
+
+ &:hover,
+ &:focus-visible,
+ &:active {
+ color: @content-primary;
+ }
+
+ &.disabled,
+ &[disabled],
+ fieldset[disabled] & {
+ &,
+ &:hover,
+ &:focus-visible,
+ &:active,
+ &.active {
+ background-color: @color-disabled;
+ border-color: @border-color-disabled;
+ color: @content-disabled;
+ }
+ }
+}
+
+.btn-borderless(@color: @white; @background: @green; @background-hover: @btn-primary-hover-bg-color) {
+ color: @color;
+ background-color: @background;
+ border-color: @background; // add a border that is same as background color so that the height matches the btn-bordered style
+
+ &:hover {
+ background-color: @background-hover;
+ border-color: @background-hover;
+ }
+
+ &:focus {
+ color: @color;
+ outline: none;
+ }
+
+ &:focus-visible,
+ &:active {
+ background-color: @background;
+ border-color: @background;
+ .box-shadow-button-input();
+ outline: none;
+ }
+
+ &:hover,
+ &:focus-visible,
+ &:active {
+ color: @color;
+ }
+
+ &.disabled,
+ &[disabled],
+ fieldset[disabled] & {
+ &,
+ &:hover,
+ &:focus-visible,
+ &:active,
+ &.active {
+ background-color: @color-disabled;
+ border-color: @color-disabled;
+ color: @content-disabled;
+ }
+ }
+}
+
// Tables
// -------------------------
.table-row-variant(@state; @background) {
@@ -706,13 +797,21 @@
// Button sizes
// -------------------------
-.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
+.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius)
+ when(@is-new-css = false) {
// Remove 1px to make up for the extra px of border-bottom we've added
padding: @padding-vertical - 1 @padding-horizontal @padding-vertical;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
}
+.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius)
+ when(@is-new-css = true) {
+ padding: @padding-vertical - @border-size @padding-horizontal;
+ font-size: @font-size;
+ line-height: @line-height;
+ border-radius: @border-radius;
+}
// Pagination
// -------------------------
@@ -1117,7 +1216,7 @@
// need to define as class for recurly UI
border-color: @input-border-focus;
outline: 0;
- box-shadow: 0px 0px 0px 2px rgba(50, 101, 178, 0.56);
+ .box-shadow-button-input();
}
.form-control-focus() when (@is-new-css = true) {
diff --git a/services/web/frontend/stylesheets/core/variables.less b/services/web/frontend/stylesheets/core/variables.less
index 4d16729e5f..22e8e45371 100644
--- a/services/web/frontend/stylesheets/core/variables.less
+++ b/services/web/frontend/stylesheets/core/variables.less
@@ -202,10 +202,6 @@
@btn-primary-bg: @ol-green;
@btn-primary-border: transparent;
-@btn-success-color: #fff;
-@btn-success-bg: @ol-green;
-@btn-success-border: transparent;
-
@btn-info-color: #fff;
@btn-info-bg: @ol-blue;
@btn-info-border: transparent;
diff --git a/services/web/frontend/stylesheets/variables/all.less b/services/web/frontend/stylesheets/variables/all.less
index 5515e13db1..31289cee8f 100644
--- a/services/web/frontend/stylesheets/variables/all.less
+++ b/services/web/frontend/stylesheets/variables/all.less
@@ -91,7 +91,7 @@
@padding-small-vertical: 5px;
@padding-small-horizontal: 10px;
-@padding-xs-vertical: 1px;
+@padding-xs-vertical: 1.5px;
@padding-xs-horizontal: 8px;
@padding-xs: 5px;
@@ -110,6 +110,7 @@
@border-width-base: 3px; // only used by plans and cards
@border-size: 1.5px;
@border-color-base: @neutral-40;
+@border-color-disabled: @color-disabled;
//** Horizontal line color.
@hr-border: @neutral-20;
@@ -161,10 +162,6 @@
@btn-primary-bg: @green;
@btn-primary-border: transparent;
-@btn-success-color: #fff;
-@btn-success-bg: @green;
-@btn-success-border: transparent;
-
@btn-info-color: #fff;
@btn-info-bg: @blue;
@btn-info-border: transparent;
@@ -191,7 +188,7 @@
//** Text color for ``s
@input-color: @neutral-90;
//** `` border color
-@input-border: @neutral-40;
+@input-border: @border-color-base;
//** `` border radius
@input-border-radius: 4px;
//** Border color for inputs on focus
@@ -710,6 +707,8 @@
@btn-border-radius-small: 9999px;
@btn-border-width: 0;
@btn-border-bottom-width: 0;
+@btn-primary-hover-bg-color: @green-dark;
+@btn-secondary-hover-bg-color: @neutral-20;
// Cards
@card-box-shadow: none;