Refactor buttons.less

pull/1/head
yflory 5 years ago
parent 70a4b3bdf2
commit 7245123061

@ -3,7 +3,6 @@
@import (reference) "./variables.less"; @import (reference) "./variables.less";
@import (reference) "./avatar.less"; @import (reference) "./avatar.less";
@import (reference) "./tools.less"; @import (reference) "./tools.less";
@import (reference) "./buttons.less";
.alertify_main() { .alertify_main() {
--LessLoader_require: LessLoader_currentFile(); --LessLoader_require: LessLoader_currentFile();
@ -272,7 +271,6 @@
} }
} }
.buttons_main();
input:not(.form-control), textarea { input:not(.form-control), textarea {
margin-bottom: 15px; margin-bottom: 15px;
} }

@ -1,7 +1,6 @@
@import (reference) "./colortheme-all.less"; @import (reference) "./colortheme-all.less";
@import (reference) "./variables.less"; @import (reference) "./variables.less";
@import (reference) "./avatar.less"; @import (reference) "./avatar.less";
@import (reference) "./buttons.less";
@import (reference) "./tools.less"; @import (reference) "./tools.less";
.comments_main() { .comments_main() {
@ -22,8 +21,6 @@
} }
.buttons_main();
.cp-comment-reply { .cp-comment-reply {
margin-left: 30px; margin-left: 30px;
} }

@ -1,7 +1,7 @@
@import (reference) "./colortheme-all.less"; @import (reference) "./colortheme-all.less";
@import (reference) "./variables.less"; @import (reference) "./variables.less";
.buttons_main() { .forms_main() {
@alertify-fore: @colortheme_modal-fg; @alertify-fore: @colortheme_modal-fg;
@alertify-btn-fg: @alertify-fore; @alertify-btn-fg: @alertify-fore;
@alertify-light-bg: fade(@alertify-fore, 25%); @alertify-light-bg: fade(@alertify-fore, 25%);
@ -83,7 +83,7 @@
margin-bottom: 3px !important; margin-bottom: 3px !important;
} }
button:not(.pure-button):not(.md-button):not(.mdl-button) { button.btn {
background-color: @colortheme_alertify-cancel; background-color: @colortheme_alertify-cancel;
box-sizing: border-box; box-sizing: border-box;

@ -16,6 +16,7 @@
@import (reference) "./cursor.less"; @import (reference) "./cursor.less";
@import (reference) "./usergrid.less"; @import (reference) "./usergrid.less";
@import (reference) "./mentions.less"; @import (reference) "./mentions.less";
@import (reference) "./forms.less";
@import (reference) "./modals-ui-elements.less"; @import (reference) "./modals-ui-elements.less";
.framework_main(@bg-color, @warn-color, @color) { .framework_main(@bg-color, @warn-color, @color) {
@ -48,6 +49,7 @@
); );
.cursor_main(); .cursor_main();
.usergrid_main(); .usergrid_main();
.forms_main();
.mentions_main(); .mentions_main();
.creation_main( .creation_main(
@bg-color: @bg-color, @bg-color: @bg-color,
@ -84,6 +86,7 @@
.checkmark_main(20px); .checkmark_main(20px);
.password_main(); .password_main();
.usergrid_main(); .usergrid_main();
.forms_main();
font: @colortheme_app-font; font: @colortheme_app-font;
} }

@ -1,8 +1,5 @@
@import (reference) "./colortheme-all.less"; @import (reference) "./colortheme-all.less";
@import (reference) "./variables.less"; @import (reference) "./variables.less";
@import (reference) './buttons.less';
.modal_base() { .modal_base() {
font-family: @colortheme_font; font-family: @colortheme_font;
@ -39,8 +36,6 @@
background-color: @colortheme_modal-dim; background-color: @colortheme_modal-dim;
.cp-modal { .cp-modal {
.buttons_main();
background-color: @colortheme_modal-bg; background-color: @colortheme_modal-bg;
color: @colortheme_modal-fg; color: @colortheme_modal-fg;
box-shadow: @variables_shadow; box-shadow: @variables_shadow;

@ -1,6 +1,5 @@
@import (reference) "/customize/src/less2/include/colortheme-all.less"; @import (reference) "/customize/src/less2/include/colortheme-all.less";
@import (reference) "/customize/src/less2/include/leftside-menu.less"; @import (reference) "/customize/src/less2/include/leftside-menu.less";
@import (reference) "/customize/src/less2/include/buttons.less";
@import (reference) "/customize/src/less2/include/browser.less"; @import (reference) "/customize/src/less2/include/browser.less";
@sidebar_button-width: 400px; @sidebar_button-width: 400px;
@ -98,7 +97,6 @@
} }
} }
margin-bottom: 20px; margin-bottom: 20px;
.buttons_main();
} }
[type="text"], [type="password"], button { [type="text"], [type="password"], button {
vertical-align: middle; vertical-align: middle;

@ -145,12 +145,12 @@ define([
}; };
dialog.okButton = function (content, classString) { dialog.okButton = function (content, classString) {
var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.ok.primary'; var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.btn.ok.primary';
return h(sel, { tabindex: '2', }, content || Messages.okButton); return h(sel, { tabindex: '2', }, content || Messages.okButton);
}; };
dialog.cancelButton = function (content, classString) { dialog.cancelButton = function (content, classString) {
var sel = typeof(classString) === 'string'? 'button.' + classString:'button.cancel'; var sel = typeof(classString) === 'string'? 'button.' + classString:'button.btn.cancel';
return h(sel, { tabindex: '1'}, content || Messages.cancelButton); return h(sel, { tabindex: '1'}, content || Messages.cancelButton);
}; };
@ -396,6 +396,7 @@ define([
buttons.forEach(function (b) { buttons.forEach(function (b) {
if (!b.name || !b.onClick) { return; } if (!b.name || !b.onClick) { return; }
var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name); var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name);
button.classList.add('btn');
var todo = function () { var todo = function () {
var noClose = b.onClick(); var noClose = b.onClick();
if (noClose) { return; } if (noClose) { return; }

@ -805,7 +805,7 @@ define([
id: 'cp-app-prop-change-password', id: 'cp-app-prop-change-password',
style: 'flex: 1;' style: 'flex: 1;'
}); });
var passwordOk = h('button', Messages.properties_changePasswordButton); var passwordOk = h('button.btn', Messages.properties_changePasswordButton);
var changePass = h('span.cp-password-change-container', [ var changePass = h('span.cp-password-change-container', [
newPassword, newPassword,
passwordOk passwordOk

@ -490,6 +490,7 @@ define([
}, { }, {
typeInput: $select[0] typeInput: $select[0]
}); });
$select.find('button').addClass('btn');
}); });
toolbar.$drawer.append($export); toolbar.$drawer.append($export);
}; };

@ -1,7 +1,6 @@
@import (reference) '../../customize/src/less2/include/framework.less'; @import (reference) '../../customize/src/less2/include/framework.less';
@import (reference) '../../customize/src/less2/include/messenger.less'; @import (reference) '../../customize/src/less2/include/messenger.less';
@import (reference) '../../customize/src/less2/include/avatar.less'; @import (reference) '../../customize/src/less2/include/avatar.less';
@import (reference) '../../customize/src/less2/include/buttons.less';
// body // body
&.cp-app-contacts { &.cp-app-contacts {
@ -19,9 +18,6 @@
display: flex; // We need this to remove a 3px border at the bottom of the toolbar display: flex; // We need this to remove a 3px border at the bottom of the toolbar
} }
.cp-app-contacts-friends {
.buttons_main();
}
.cp-contacts-muted-table { .cp-contacts-muted-table {
.avatar_main(50px); .avatar_main(50px);
.cp-contacts-muted-user { .cp-contacts-muted-user {
@ -33,8 +29,6 @@
} }
} }
.messenger_main(); .messenger_main();
} }

@ -3,7 +3,6 @@
@import (reference) "../../customize/src/less2/include/tools.less"; @import (reference) "../../customize/src/less2/include/tools.less";
@import (reference) "../../customize/src/less2/include/markdown.less"; @import (reference) "../../customize/src/less2/include/markdown.less";
@import (reference) "../../customize/src/less2/include/avatar.less"; @import (reference) "../../customize/src/less2/include/avatar.less";
@import (reference) "../../customize/src/less2/include/buttons.less";
// body // body
&.cp-app-kanban { &.cp-app-kanban {
@ -310,7 +309,6 @@
position: relative; position: relative;
min-height: 50px; min-height: 50px;
.cp-kanban-filterTags { .cp-kanban-filterTags {
.buttons_main();
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
flex: 1; flex: 1;

@ -1,6 +1,5 @@
@import (reference) "../../customize/src/less2/include/framework.less"; @import (reference) "../../customize/src/less2/include/framework.less";
@import (reference) "../../customize/src/less2/include/comments.less"; @import (reference) "../../customize/src/less2/include/comments.less";
@import (reference) "../../customize/src/less2/include/buttons.less";
body.cp-app-pad { body.cp-app-pad {
.framework_main( .framework_main(
@ -71,7 +70,6 @@ body.cp-app-pad {
order: 1; order: 1;
} }
div.cp-comment-bubble { div.cp-comment-bubble {
.buttons_main();
position: relative; position: relative;
order: 2; order: 2;
button { button {

@ -8,6 +8,7 @@
@import (reference) '../../customize/src/less2/include/password-input.less'; @import (reference) '../../customize/src/less2/include/password-input.less';
@import (reference) '../../customize/src/less2/include/modals-ui-elements.less'; @import (reference) '../../customize/src/less2/include/modals-ui-elements.less';
@import (reference) '../../customize/src/less2/include/usergrid.less'; @import (reference) '../../customize/src/less2/include/usergrid.less';
@import (reference) '../../customize/src/less2/include/forms.less';
&.cp-app-secureiframe { &.cp-app-secureiframe {
.modals-ui-elements_main(); .modals-ui-elements_main();
@ -19,6 +20,7 @@
.password_main(); .password_main();
.modal_main(); .modal_main();
.usergrid_main(); .usergrid_main();
.forms_main();
#cp-filepicker-dialog { #cp-filepicker-dialog {
display: none; display: none;

@ -1,6 +1,5 @@
@import (reference) '../../customize/src/less2/include/tools.less'; @import (reference) '../../customize/src/less2/include/tools.less';
@import (reference) "../../customize/src/less2/include/framework.less"; @import (reference) "../../customize/src/less2/include/framework.less";
@import (reference) "../../customize/src/less2/include/buttons.less";
&.cp-app-whiteboard { &.cp-app-whiteboard {
@ -74,8 +73,6 @@
padding: 10px; padding: 10px;
.buttons_main();
& > * + * { & > * + * {
margin: 0; margin: 0;
margin-left: 1em; margin-left: 1em;

Loading…
Cancel
Save