1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 19:44:21 +00:00

Update style a bit

This commit is contained in:
Steffo 2020-08-12 01:44:47 +02:00
parent a2939bfc99
commit 46ca8c3834
16 changed files with 82 additions and 190 deletions

View file

@ -1,10 +0,0 @@
import style from "./HZero.less";
import concatClass from "../../utils/concatClass";
export default function (props) {
return (
<div class={concatClass(style.h0, props.class)}>
{props.children}
</div>
);
}

View file

@ -1,9 +0,0 @@
@import "../../styles/constants.less";
.h0 {
display: block;
text-align: center;
color: @accent;
font-family: @title;
font-size: 48px;
}

View file

@ -1,7 +1,10 @@
import style from "./Image.less";
import {concatClass} from "../../index";
export default function(props) { export default function(props) {
return ( return (
<a href={props.src} title={props.alt} target={"_blank"} class={props.aClass}> <a href={props.src} title={props.alt} target={"_blank"} class={props.aClass}>
<img src={props.src} alt={props.alt} class={props.imgClass}/> <img src={props.src} alt={props.alt} class={concatClass(style.img, props.imgClass)}/>
</a> </a>
) )
} }

View file

@ -0,0 +1,5 @@
.img {
max-width: 100%;
max-height: 300px;
border-radius: 4px;
}

View file

@ -1,3 +1,4 @@
@import "../../styles/mixins.less";
@import "../../styles/constants.less"; @import "../../styles/constants.less";
.timer { .timer {
@ -9,8 +10,8 @@
margin-bottom: 8px; margin-bottom: 8px;
padding: 8px; padding: 8px;
grid-template-columns: 80px 80px 80px 80px; grid-template-columns: 80px 80px 80px 80px;
border: 2px solid @plusplus;
border-radius: 4px; .bordered(@fg, @bg);
} }
.days { .days {
@ -41,8 +42,7 @@
} }
.unknown { .unknown {
color: @magenta; .bordered(@magenta, @bg);
border: 2px solid fade(@magenta, 20%);
.count { .count {
color: @magenta; color: @magenta;
@ -50,8 +50,7 @@
} }
.expired { .expired {
color: @red; .bordered(@red, @bg);
border: 2px solid fade(@red, 20%);
.count { .count {
color: @red; color: @red;

View file

@ -1,9 +1,6 @@
@import "../../styles/mixins.less";
@import "../../styles/constants.less"; @import "../../styles/constants.less";
.todo { .todo {
border: 1px yellow solid; .bordered(yellow, black);
border-radius: 2px;
padding: 1px;
background-color: black;
color: yellow;
} }

View file

@ -9,41 +9,41 @@
} }
.default { .default {
background-color: fade(@fg, 5%); border: 2px solid fade(@fg, 10%);
color: @fg; color: @fg;
} }
.red { .red {
background-color: fade(@red, 5%); border: 2px solid fade(@red, 10%);
color: @red; color: @red;
} }
.orange { .orange {
background-color: fade(@orange, 5%); border: 2px solid fade(@orange, 10%);
color: @orange; color: @orange;
} }
.yellow { .yellow {
background-color: fade(@yellow, 5%); border: 2px solid fade(@yellow, 10%);
color: @yellow; color: @yellow;
} }
.lime { .lime {
background-color: fade(@lime, 5%); border: 2px solid fade(@lime, 10%);
color: @lime; color: @lime;
} }
.cyan { .cyan {
background-color: fade(@cyan, 5%); border: 2px solid fade(@cyan, 10%);
color: @cyan; color: @cyan;
} }
.blue { .blue {
background-color: fade(@blue, 5%); border: 2px solid fade(@blue, 10%);
color: @blue; color: @blue;
} }
.magenta { .magenta {
background-color: fade(@magenta, 5%); border: 2px solid fade(@magenta, 10%);
color: @magenta; color: @magenta;
} }

View file

@ -1,13 +1,12 @@
import style from "./Panel.less";
import Box from "./Box"; import Box from "./Box";
export default function(props) { export default function(props) {
return ( return (
<Box color={props.color} class={props.class}> <Box color={props.color} class={props.class}>
<h3 class={style.title}> <h3>
{props.title} {props.title}
</h3> </h3>
<div class={style.contents}> <div>
{props.children} {props.children}
</div> </div>
</Box> </Box>

View file

@ -1,10 +0,0 @@
@import "../../styles/constants.less";
.title {
font-family: @title;
}
.contents {
font-family: @text;
}

View file

@ -1,15 +1,14 @@
import Split from "../Layout/Split"; import Split from "../Layout/Split";
import {Fragment} from "preact";
export default function (props) { export default function (props) {
return ( return (
<Fragment> <div>
<h2> <h2>
{props.title} {props.title}
</h2> </h2>
<Split> <Split>
{props.children} {props.children}
</Split> </Split>
</Fragment> </div>
); );
} }

View file

@ -7,6 +7,6 @@
h1 { h1 {
padding-bottom: 2px; padding-bottom: 2px;
border-bottom: 1px solid @plusplusplus; border-bottom: 1px solid fade(@fg, 15%);
} }
} }

View file

@ -9,7 +9,6 @@ import FormButton from "./components/Forms/FormButton";
import FormInput from "./components/Forms/FormInput"; import FormInput from "./components/Forms/FormInput";
import FormRow from "./components/Forms/FormRow"; import FormRow from "./components/Forms/FormRow";
import getEventValue from "./utils/getEventValue"; import getEventValue from "./utils/getEventValue";
import HZero from "./components/Elements/HZero";
import ILatex from "./components/Rendering/ILatex"; import ILatex from "./components/Rendering/ILatex";
import Image from "./components/Elements/Image"; import Image from "./components/Elements/Image";
import isString from "./utils/isString"; import isString from "./utils/isString";
@ -58,7 +57,6 @@ export {
FormInput, FormInput,
FormRow, FormRow,
getEventValue, getEventValue,
HZero,
ILatex, ILatex,
Image, Image,
isString, isString,

View file

@ -30,28 +30,44 @@ export default function (props) {
</h1> </h1>
<Section title={"Panels"}> <Section title={"Panels"}>
<Panel title={"Default"}> <Panel title={"Default"}>
<p>
This is a default panel. This is a default panel.
</p>
</Panel> </Panel>
<Panel title={"Red"} color={BoxColors.RED}> <Panel title={"Red"} color={BoxColors.RED}>
<p>
This is a red panel. This is a red panel.
</p>
</Panel> </Panel>
<Panel title={"Orange"} color={BoxColors.ORANGE}> <Panel title={"Orange"} color={BoxColors.ORANGE}>
<p>
This is a orange panel. This is a orange panel.
</p>
</Panel> </Panel>
<Panel title={"Yellow"} color={BoxColors.YELLOW}> <Panel title={"Yellow"} color={BoxColors.YELLOW}>
<p>
This is a yellow panel. This is a yellow panel.
</p>
</Panel> </Panel>
<Panel title={"Lime"} color={BoxColors.LIME}> <Panel title={"Lime"} color={BoxColors.LIME}>
<p>
This is a lime panel. This is a lime panel.
</p>
</Panel> </Panel>
<Panel title={"Cyan"} color={BoxColors.CYAN}> <Panel title={"Cyan"} color={BoxColors.CYAN}>
<p>
This is a cyan panel. This is a cyan panel.
</p>
</Panel> </Panel>
<Panel title={"Blue"} color={BoxColors.BLUE}> <Panel title={"Blue"} color={BoxColors.BLUE}>
<p>
This is a blue panel. This is a blue panel.
</p>
</Panel> </Panel>
<Panel title={"Magenta"} color={BoxColors.MAGENTA}> <Panel title={"Magenta"} color={BoxColors.MAGENTA}>
<p>
This is a magenta panel. This is a magenta panel.
</p>
</Panel> </Panel>
</Section> </Section>
<Section title={"Code"}> <Section title={"Code"}>

View file

@ -1,7 +1,4 @@
@bg: #0d193b; @bg: #0d193b;
@bg-light: #142245;
@bg-lighter: #1c2b4f;
@bg-lightest: #233358;
@fg: #a0ccff; @fg: #a0ccff;
@accent: #ffffff; @accent: #ffffff;
@ -9,11 +6,6 @@
@linkhover: #00ffff; @linkhover: #00ffff;
@linkactive: #a0ffff; @linkactive: #a0ffff;
@plus: fade(@fg, 5%);
@plusplus: fade(@fg, 10%);
@plusplusplus: fade(@fg, 15%);
@plusplusplusplus: fade(@fg, 20%);
@red: #ff7d7d; @red: #ff7d7d;
@orange: #ffbb7d; @orange: #ffbb7d;
@yellow: #ffff7d; @yellow: #ffff7d;
@ -30,10 +22,3 @@
@warningbg: #231c00; @warningbg: #231c00;
@errorfg: @red; @errorfg: @red;
@errorbg: #330e00; @errorbg: #330e00;
@sans: "Arial", sans-serif;
@text: "Calibri", sans-serif;
@title: "Verdana", sans-serif;
@mono: "Consolas", "SFMono-Regular", "Liberation Mono", "Menlo", monospace;
@example: #d3a1ff;

View file

@ -1,43 +1,24 @@
@import "constants.less"; /// A bordered item
.bordered(@hfg; @hbg) {
.h(@hfg; @hbg) {
color: @hfg; color: @hfg;
background-color: @hbg; background-color: @hbg;
}
.hb(@hfg; @hbg) {
.h(@hfg; @hbg);
border: 1px solid fade(@hfg, 10%); border: 1px solid fade(@hfg, 10%);
} }
.hh(@hfg; @hbg) { /// A hoverable element
.hb(@hfg; @hbg); .hoverable(@hfg, @hbg) {
&:hover, &.hover { &:hover, &.hover {
background-color: overlay(fade(@hfg, 10%), @hbg); background-color: overlay(fade(@hfg, 10%), @hbg);
border: 1px solid @hfg; border: 1px solid @hfg;
color: @hfg; color: screen(@hfg, #808080);
}
} }
/// A clickable element
.clickable(@hfg, @hbg) {
&:active, &.active { &:active, &.active {
background-color: overlay(fade(@accent, 20%), @hbg); background-color: overlay(rgba(255, 255, 255, 0.2), @hbg);
border: 1px solid @accent; border: 1px solid white;
color: @accent; color: white;
}
}
.hnh(@hfg; @hbg) {
.hb(@hfg; @hbg);
&:hover, &.hover {
background-color: @hbg;
border: 1px solid fade(@hfg, 10%);
color: @hfg;
}
&:active, &.active {
background-color: @hbg;
border: 1px solid fade(@hfg, 10%);
color: @hfg;
} }
} }

View file

@ -4,17 +4,14 @@
.bluelib { .bluelib {
background-color: @bg; background-color: @bg;
color: @fg; color: @fg;
font-family: @sans; font-family: sans-serif;
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
margin-top: 4px;
margin-bottom: 4px;
color: @accent; color: @accent;
font-family: @title;
font-weight: normal; font-weight: normal;
text-align: center; text-align: center;
} }
@ -37,119 +34,61 @@
} }
} }
img, iframe {
max-width: 100%;
max-height: 300px;
border-radius: 4px;
}
pre, code { pre, code {
font-family: @mono; font-family: monospace;
font-size: 14px; font-size: 14px;
} }
blockquote { blockquote {
color: @fg; color: @fg;
border-left: 3px solid @plusplusplusplus; border-left: 3px solid fade(@fg, 20%);
background-color: @plus; background-color: fade(@fg, 5%);
padding: 4px 4px 4px 8px; padding: 4px 4px 4px 8px;
margin: 8px 0; margin: 8px 0;
} }
input[type="text"], input[type="password"] { input:not([type="checkbox"]):not([type="radio"]) {
.hb(@fg; @bg); .bordered(@fg; @bg);
border-radius: 4px; border-radius: 4px;
padding: 4px; padding: 4px;
font-size: medium; font-size: medium;
} }
button { button, input[type="button"], input[type="submit"] {
.hh(@fg, @bg); .bordered(@fg; @bg);
:not([disabled]) {
.hoverable(@fg; @bg);
.clickable(@fg; @bg);
}
border-radius: 4px; border-radius: 4px;
padding: 4px; padding: 4px;
font-size: medium; font-size: medium;
} }
.ok {
color: @okfg;
input[type="text"], input[type="password"] {
.hb(@okfg; @okbg);
}
button {
.hh(@okfg, @okbg);
}
}
.warning {
color: @warningfg;
input[type="text"], input[type="password"] {
.hb(@warningfg; @warningbg);
}
button {
.hh(@warningfg, @warningbg);
}
}
.error {
color: @errorfg;
input[type="text"], input[type="password"] {
.hb(@errorfg; @errorbg);
}
button {
.hh(@errorfg; @errorbg);
}
}
.disabled {
color: @disabledfg;
cursor: not-allowed;
input[type="text"], input[type="password"] {
.hb(@disabledfg; @disabledbg);
}
button {
.hnh(@disabledfg, @disabledbg);
}
}
input[type="text"][disabled], input[type="password"][disabled] {
.hb(@disabledfg; @disabledbg);
}
button[disabled] {
.hnh(@disabledfg, @disabledbg);
}
hr { hr {
border: 1px solid @plusplusplusplus; border: 1px solid fade(@fg, 20%);
margin-top: 24px; margin-top: 24px;
margin-bottom: 24px; margin-bottom: 24px;
} }
table { table {
border-spacing: 0; border-spacing: 0;
border: 2px solid @plusplus; border: 2px solid fade(@fg, 10%);
background-color: @plus; background-color: fade(@fg, 5%);
border-collapse: collapse; border-collapse: collapse;
thead, tbody { thead, tbody {
th, td { th, td {
padding: 4px; padding: 4px;
border: 1px solid @plusplus; border: 1px solid fade(@fg, 10%);
} }
} }
thead { thead {
background-color: @plusplus; background-color: fade(@fg, 10%);
color: @accent; color: @accent;
} }
} }
@ -170,7 +109,7 @@
margin: 4px 0; margin: 4px 0;
padding: 4px; padding: 4px;
font-size: smaller; font-size: smaller;
background-color: @plus; background-color: fade(@fg, 5%);
border-radius: 4px; border-radius: 4px;
} }
} }