Add more button variables

This commit is contained in:
Jeremy Thomas 2023-02-03 12:25:54 +00:00
parent 3c7d60b802
commit c5312c4696
5 changed files with 180 additions and 83 deletions

1
docs/.gitignore vendored
View File

@ -27,5 +27,6 @@ test.scss
/dev /dev
/icons /icons
/styles/node_modules /styles/node_modules
/test
/versions /versions
_site _site

2
docs/bulma.scss vendored
View File

@ -1,3 +1,3 @@
@charset "utf-8"; @charset "utf-8";
@import "../bulma"; @import "../bulma";
// @import "../sass/themes/dark"; @import "../sass/themes/dark";

157
docs/css/bulma.css vendored
View File

@ -539,6 +539,7 @@ a.box:active {
--bulma-button-color: var(--bulma-text-strong); --bulma-button-color: var(--bulma-text-strong);
--bulma-button-background-color: var(--bulma-scheme-main); --bulma-button-background-color: var(--bulma-scheme-main);
--bulma-button-family: false; --bulma-button-family: false;
--bulma-button-weight: var(--bulma-weight-medium);
--bulma-button-border-color: var(--bulma-border); --bulma-button-border-color: var(--bulma-border);
--bulma-button-border-width: var(--bulma-control-border-width); --bulma-button-border-width: var(--bulma-control-border-width);
--bulma-button-padding-vertical: calc( 0.5em - var(--bulma-button-border-width)); --bulma-button-padding-vertical: calc( 0.5em - var(--bulma-button-border-width));
@ -586,6 +587,7 @@ a.box:active {
border-width: var(--bulma-button-border-width); border-width: var(--bulma-button-border-width);
color: var(--bulma-button-color); color: var(--bulma-button-color);
cursor: pointer; cursor: pointer;
font-weight: var(--bulma-button-weight);
justify-content: center; justify-content: center;
padding-bottom: var(--bulma-button-padding-vertical); padding-bottom: var(--bulma-button-padding-vertical);
padding-left: var(--bulma-button-padding-horizontal); padding-left: var(--bulma-button-padding-horizontal);
@ -5651,6 +5653,9 @@ button.dropdown-item.is-active {
--bulma-message-body-pre-background-color: var(--bulma-scheme-main); --bulma-message-body-pre-background-color: var(--bulma-scheme-main);
--bulma-message-body-pre-code-background-color: transparent; --bulma-message-body-pre-code-background-color: transparent;
--bulma-message-header-body-border-width: 0; --bulma-message-header-body-border-width: 0;
--bulma-message-status-background-l: 8%;
--bulma-message-status-color-l: 70%;
--bulma-message-status-header-background-l: 20%;
} }
.message { .message {
@ -5681,151 +5686,179 @@ button.dropdown-item.is-active {
} }
.message.is-white { .message.is-white {
background-color: white; --base-s: var(--bulma-white-s);
--base-l: var(--bulma-white-l);
background: none;
} }
.message.is-white .message-header { .message.is-white .message-header {
background-color: white; background-color: hsl(var(--bulma-white-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #0a0a0a; color: var(--bulma-white-invert);
} }
.message.is-white .message-body { .message.is-white .message-body {
border-color: white; background-color: hsl(var(--bulma-white-h), var(--base-s), var(--bulma-message-status-background-l));
color: hsl(var(--bulma-white-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-black { .message.is-black {
background-color: #fafafa; --base-s: var(--bulma-black-s);
--base-l: var(--bulma-black-l);
background: none;
} }
.message.is-black .message-header { .message.is-black .message-header {
background-color: #0a0a0a; background-color: hsl(var(--bulma-black-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: white; color: var(--bulma-black-invert);
} }
.message.is-black .message-body { .message.is-black .message-body {
border-color: #0a0a0a; background-color: hsl(var(--bulma-black-h), var(--base-s), var(--bulma-message-status-background-l));
color: hsl(var(--bulma-black-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-light { .message.is-light {
background-color: #fafafa; --base-s: var(--bulma-light-s);
--base-l: var(--bulma-light-l);
background: none;
} }
.message.is-light .message-header { .message.is-light .message-header {
background-color: whitesmoke; background-color: hsl(var(--bulma-light-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: rgba(0, 0, 0, 0.7); color: var(--bulma-light-invert);
} }
.message.is-light .message-body { .message.is-light .message-body {
border-color: whitesmoke; background-color: hsl(var(--bulma-light-h), var(--base-s), var(--bulma-message-status-background-l));
color: hsl(var(--bulma-light-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-dark { .message.is-dark {
background-color: #fafafa; --base-s: var(--bulma-dark-s);
--base-l: var(--bulma-dark-l);
background: none;
} }
.message.is-dark .message-header { .message.is-dark .message-header {
background-color: #363636; background-color: hsl(var(--bulma-dark-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-dark-invert);
} }
.message.is-dark .message-body { .message.is-dark .message-body {
border-color: #363636; background-color: hsl(var(--bulma-dark-h), var(--base-s), var(--bulma-message-status-background-l));
color: hsl(var(--bulma-dark-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-primary { .message.is-primary {
background-color: #ebfffc; --base-s: var(--bulma-primary-s);
--base-l: var(--bulma-primary-l);
background: none;
} }
.message.is-primary .message-header { .message.is-primary .message-header {
background-color: #00d1b2; background-color: hsl(var(--bulma-primary-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-primary-invert);
} }
.message.is-primary .message-body { .message.is-primary .message-body {
border-color: #00d1b2; background-color: hsl(var(--bulma-primary-h), var(--base-s), var(--bulma-message-status-background-l));
color: #00947e; color: hsl(var(--bulma-primary-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-link { .message.is-link {
background-color: #f7f8fd; --base-s: var(--bulma-link-s);
--base-l: var(--bulma-link-l);
background: none;
} }
.message.is-link .message-header { .message.is-link .message-header {
background-color: #3c57d3; background-color: hsl(var(--bulma-link-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-link-invert);
} }
.message.is-link .message-body { .message.is-link .message-body {
border-color: #3c57d3; background-color: hsl(var(--bulma-link-h), var(--base-s), var(--bulma-message-status-background-l));
color: hsl(var(--bulma-link-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-info { .message.is-info {
background-color: #ebf9fe; --base-s: var(--bulma-info-s);
--base-l: var(--bulma-info-l);
background: none;
} }
.message.is-info .message-header { .message.is-info .message-header {
background-color: #18b4f7; background-color: hsl(var(--bulma-info-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-info-invert);
} }
.message.is-info .message-body { .message.is-info .message-body {
border-color: #18b4f7; background-color: hsl(var(--bulma-info-h), var(--base-s), var(--bulma-message-status-background-l));
color: #0677a7; color: hsl(var(--bulma-info-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-success { .message.is-success {
background-color: #effbf4; --base-s: var(--bulma-success-s);
--base-l: var(--bulma-success-l);
background: none;
} }
.message.is-success .message-header { .message.is-success .message-header {
background-color: #3fcf82; background-color: hsl(var(--bulma-success-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-success-invert);
} }
.message.is-success .message-body { .message.is-success .message-body {
border-color: #3fcf82; background-color: hsl(var(--bulma-success-h), var(--base-s), var(--bulma-message-status-background-l));
color: #1e7647; color: hsl(var(--bulma-success-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-warning { .message.is-warning {
background-color: #fff9eb; --base-s: var(--bulma-warning-s);
--base-l: var(--bulma-warning-l);
background: none;
} }
.message.is-warning .message-header { .message.is-warning .message-header {
background-color: #ffb60a; background-color: hsl(var(--bulma-warning-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: var(--bulma-white); color: var(--bulma-warning-invert);
} }
.message.is-warning .message-body { .message.is-warning .message-body {
border-color: #ffb60a; background-color: hsl(var(--bulma-warning-h), var(--base-s), var(--bulma-message-status-background-l));
color: #946800; color: hsl(var(--bulma-warning-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-danger { .message.is-danger {
background-color: #feedec; --base-s: var(--bulma-danger-s);
--base-l: var(--bulma-danger-l);
background: none;
} }
.message.is-danger .message-header { .message.is-danger .message-header {
background-color: #f15146; background-color: hsl(var(--bulma-danger-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-danger-invert);
} }
.message.is-danger .message-body { .message.is-danger .message-body {
border-color: #f15146; background-color: hsl(var(--bulma-danger-h), var(--base-s), var(--bulma-message-status-background-l));
color: #c71b0f; color: hsl(var(--bulma-danger-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message.is-text { .message.is-text {
background-color: #f9fafb; --base-s: var(--bulma-text-s);
--base-l: var(--bulma-text-l);
background: none;
} }
.message.is-text .message-header { .message.is-text .message-header {
background-color: #404654; background-color: hsl(var(--bulma-text-h), var(--base-s), var(--bulma-message-status-header-background-l));
color: #fff; color: var(--bulma-text-invert);
} }
.message.is-text .message-body { .message.is-text .message-body {
border-color: #404654; background-color: hsl(var(--bulma-text-h), var(--base-s), var(--bulma-message-status-background-l));
color: hsl(var(--bulma-text-h), var(--base-s), var(--bulma-message-status-color-l));
} }
.message-header { .message-header {
@ -13113,3 +13146,29 @@ a.has-text-text:hover, a.has-text-text:focus {
) )
);*/ );*/
} }
[data-theme="dark"],
.theme-dark {
--bulma-scheme-main: #121212;
--bulma-scheme-main-bis: #242424;
--bulma-scheme-main-ter: #363636;
--bulma-scheme-invert: white;
--bulma-scheme-invert-bis: #fafafa;
--bulma-scheme-invert-ter: whitesmoke;
--bulma-background: #242424;
--bulma-border: #363636;
--bulma-border-hover: #4a4a4a;
--bulma-border-light: #363636;
--bulma-border-light-hover: #4a4a4a;
--bulma-text: #b5b5b5;
--bulma-text-invert: #363636;
--bulma-text-light: #7a7a7a;
--bulma-text-strong: white;
--bulma-link-hover: white;
--bulma-link-hover-border: #4a4a4a;
--bulma-link-focus: white;
--bulma-link-focus-border: #3c57d3;
--bulma-link-active: white;
--bulma-link-active-border: #b5b5b5;
--bulma-shadow: 0 0.5em 1em -0.125em rgba(255, 255, 255, 0.2), 0 0px 0 1px rgba(255, 255, 255, 0.04);
}

View File

@ -39,6 +39,9 @@ $message-colors: $colors !default;
message-body-pre-background-color: #{$message-body-pre-background-color}, message-body-pre-background-color: #{$message-body-pre-background-color},
message-body-pre-code-background-color: #{$message-body-pre-code-background-color}, message-body-pre-code-background-color: #{$message-body-pre-code-background-color},
message-header-body-border-width: #{$message-header-body-border-width}, message-header-body-border-width: #{$message-header-body-border-width},
message-status-background-l: 8%,
message-status-color-l: 70%,
message-status-header-background-l: 20%,
) )
); );
} }
@ -75,44 +78,76 @@ $message-colors: $colors !default;
// Colors // Colors
// TODO // TODO
@each $name, $components in $message-colors { @each $name, $components in $message-colors {
$color: nth($components, 1); $base-h: getVar($name, "", "-h");
$color-invert: nth($components, 2); $base-s: getVar($name, "", "-s");
$color-light: null; $base-l: getVar($name, "", "-l");
$color-dark: null; $invert: getVar($name, "", "-invert");
$base: hsl($base-h, var(--s), var(--l));
@if length($components) >= 3 {
$color-light: nth($components, 3);
@if length($components) >= 4 {
$color-dark: nth($components, 4);
} @else {
$color-luminance: colorLuminance($color);
$darken-percentage: $color-luminance * 70%;
$desaturate-percentage: $color-luminance * 30%;
$color-dark: desaturate(
darken($color, $darken-percentage),
$desaturate-percentage
);
}
} @else {
$color-lightning: max(100% - lightness($color) - 2%, 0%);
$color-light: lighten($color, $color-lightning);
}
&.is-#{$name} { &.is-#{$name} {
background-color: $color-light; --base-s: #{$base-s};
--base-l: #{$base-l};
background: none;
.#{$class-prefix}message-header { .#{$class-prefix}message-header {
background-color: $color; background-color: hsl(
color: $color-invert; $base-h,
var(--base-s),
var(--bulma-message-status-header-background-l)
);
color: $invert;
} }
.#{$class-prefix}message-body { .#{$class-prefix}message-body {
border-color: $color; background-color: hsl(
color: $color-dark; $base-h,
var(--base-s),
var(--bulma-message-status-background-l)
);
color: hsl($base-h, var(--base-s), var(--bulma-message-status-color-l));
} }
} }
} }
// @each $name, $components in $message-colors {
// $color: nth($components, 1);
// $color-invert: nth($components, 2);
// $color-light: null;
// $color-dark: null;
// @if length($components) >= 3 {
// $color-light: nth($components, 3);
// @if length($components) >= 4 {
// $color-dark: nth($components, 4);
// } @else {
// $color-luminance: colorLuminance($color);
// $darken-percentage: $color-luminance * 70%;
// $desaturate-percentage: $color-luminance * 30%;
// $color-dark: desaturate(
// darken($color, $darken-percentage),
// $desaturate-percentage
// );
// }
// } @else {
// $color-lightning: max(100% - lightness($color) - 2%, 0%);
// $color-light: lighten($color, $color-lightning);
// }
// &.is-#{$name} {
// background-color: $color-light;
// .#{$class-prefix}message-header {
// background-color: $color;
// color: $color-invert;
// }
// .#{$class-prefix}message-body {
// border-color: $color;
// color: $color-dark;
// }
// }
// }
} }
.#{$class-prefix}message-header { .#{$class-prefix}message-header {

View File

@ -4,6 +4,7 @@
$button-color: getVar("text-strong") !default; $button-color: getVar("text-strong") !default;
$button-background-color: getVar("scheme-main") !default; $button-background-color: getVar("scheme-main") !default;
$button-family: false !default; $button-family: false !default;
$button-weight: getVar("weight-medium") !default;
$button-border-color: getVar("border") !default; $button-border-color: getVar("border") !default;
$button-border-width: getVar("control-border-width") !default; $button-border-width: getVar("control-border-width") !default;
@ -101,6 +102,7 @@ $button-responsive-sizes: (
button-color: #{$button-color}, button-color: #{$button-color},
button-background-color: #{$button-background-color}, button-background-color: #{$button-background-color},
button-family: #{$button-family}, button-family: #{$button-family},
button-weight: #{$button-weight},
button-border-color: #{$button-border-color}, button-border-color: #{$button-border-color},
button-border-width: #{$button-border-width}, button-border-width: #{$button-border-width},
button-padding-vertical: #{$button-padding-vertical}, button-padding-vertical: #{$button-padding-vertical},
@ -153,11 +155,7 @@ $button-responsive-sizes: (
border-width: getVar("button-border-width"); border-width: getVar("button-border-width");
color: getVar("button-color"); color: getVar("button-color");
cursor: pointer; cursor: pointer;
font-weight: getVar("button-weight");
@if $button-family {
font-family: getVar("button-family");
}
justify-content: center; justify-content: center;
padding-bottom: getVar("button-padding-vertical"); padding-bottom: getVar("button-padding-vertical");
padding-left: getVar("button-padding-horizontal"); padding-left: getVar("button-padding-horizontal");
@ -166,6 +164,10 @@ $button-responsive-sizes: (
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
@if $button-family {
font-family: getVar("button-family");
}
strong { strong {
color: inherit; color: inherit;
} }