mirror of
https://github.com/keeweb/keeweb.git
synced 2024-06-27 07:45:08 +02:00
contrast text color on buttons
This commit is contained in:
parent
b4adfcb9df
commit
be491aee52
|
@ -14,6 +14,12 @@ $(function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KeyHandler.init();
|
KeyHandler.init();
|
||||||
|
|
||||||
|
var appModel = new AppModel();
|
||||||
|
if (appModel.settings.get('theme')) {
|
||||||
|
document.body.setAttribute('class', 'th-' + appModel.settings.get('theme'));
|
||||||
|
}
|
||||||
|
|
||||||
if (['https:', 'file:', 'app:'].indexOf(location.protocol) < 0) {
|
if (['https:', 'file:', 'app:'].indexOf(location.protocol) < 0) {
|
||||||
Alerts.error({ header: 'Not Secure!', icon: 'user-secret', esc: false, enter: false, click: false,
|
Alerts.error({ header: 'Not Secure!', icon: 'user-secret', esc: false, enter: false, click: false,
|
||||||
body: 'You have loaded this app with insecure connection. ' +
|
body: 'You have loaded this app with insecure connection. ' +
|
||||||
|
@ -31,7 +37,6 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showApp() {
|
function showApp() {
|
||||||
var appModel = new AppModel();
|
|
||||||
new AppView({ model: appModel }).render().showOpenFile(appModel.settings.get('lastOpenFile'));
|
new AppView({ model: appModel }).render().showOpenFile(appModel.settings.get('lastOpenFile'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,11 +20,12 @@
|
||||||
@include th {
|
@include th {
|
||||||
border: 1px solid action-color();
|
border: 1px solid action-color();
|
||||||
background-color: action-color();
|
background-color: action-color();
|
||||||
color: text-color();
|
color: text-contrast-color(action-color());
|
||||||
|
|
||||||
&.btn-error, &.btn-silent {
|
&.btn-error, &.btn-silent {
|
||||||
border-color: base-border-color();
|
border-color: base-border-color();
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
color: text-contrast-color(background-color());
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
@ -38,7 +39,6 @@
|
||||||
border-color: action-background-color-focus();
|
border-color: action-background-color-focus();
|
||||||
background-color: rgba(action-background-color-focus(), .1);
|
background-color: rgba(action-background-color-focus(), .1);
|
||||||
}
|
}
|
||||||
color: text-color();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
|
|
|
@ -20,6 +20,7 @@ $violet: #d946db;
|
||||||
@function muted-color-border() { @return mix(medium-color(), background-color(), 15%); }
|
@function muted-color-border() { @return mix(medium-color(), background-color(), 15%); }
|
||||||
@function text-selection-bg-color() { @return rgba(action-color(), .3); }
|
@function text-selection-bg-color() { @return rgba(action-color(), .3); }
|
||||||
@function text-selection-bg-color-error() { @return rgba(error-color(), .8); }
|
@function text-selection-bg-color-error() { @return rgba(error-color(), .8); }
|
||||||
|
@function text-contrast-color($bg) { @if (lightness($bg) >= lightness(background-color())) { @return text-color(); } @else { @return background-color(); } }
|
||||||
|
|
||||||
// Borders, shadows
|
// Borders, shadows
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user