Styled search bar, changes in theme vars
This commit is contained in:
parent
ebf6564011
commit
b303b515e3
3 changed files with 96 additions and 14 deletions
|
@ -2,7 +2,7 @@ body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: var(--gradient);
|
background: var(--bg-gradient);
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
@ -35,3 +35,73 @@ main {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
.search-box {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
// FIXME
|
||||||
|
width: 100%;
|
||||||
|
max-width: 50rem;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-clear {
|
||||||
|
position: absolute;
|
||||||
|
right: 0.2rem;
|
||||||
|
|
||||||
|
input {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--fg);
|
||||||
|
font-size: 1.125rem;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@btn-padding: 0.625rem;
|
||||||
|
@btn-font: 1.5rem;
|
||||||
|
@height: @btn-font + @btn-padding * 2;
|
||||||
|
@bdrs: @height * 0.25;
|
||||||
|
|
||||||
|
.search input {
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: @height;
|
||||||
|
|
||||||
|
background: var(--bg-sec);
|
||||||
|
color: var(--fg);
|
||||||
|
font-size: 1.125rem;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
border-top-left-radius: @bdrs;
|
||||||
|
border-bottom-left-radius: @bdrs;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-submit input {
|
||||||
|
padding: @btn-padding;
|
||||||
|
|
||||||
|
background: var(--gradient);
|
||||||
|
color: #fff;
|
||||||
|
font-size: @btn-font;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
border-top-right-radius: @bdrs;
|
||||||
|
border-bottom-right-radius: @bdrs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,23 @@
|
||||||
.theme-mixin(@light: bool) {
|
.theme-mixin(@light: bool) {
|
||||||
|
// TODO: awful, use just hsl() instead of magic multipliers or percentages in lighten/darken
|
||||||
|
// Also, it's not good to depend on the background color.
|
||||||
|
// Maybe, implement MD3 guidelines.
|
||||||
@bg: if(@light, #e8e8ff, #181822);
|
@bg: if(@light, #e8e8ff, #181822);
|
||||||
@fg: if(@light, #111111, #eeeeee);
|
@fg: if(@light, #111111, #eeeeee);
|
||||||
|
@bg-sec: if(@light, darken(@bg, 10%), lighten(@bg, 30%));
|
||||||
@mult: if(@light, 0.75, 2.75);
|
@mult: if(@light, 0.75, 2.75);
|
||||||
|
@color1: hsl(hue(@bg), saturation(@bg) * @mult, lightness(@bg) * @mult);
|
||||||
|
@color2: spin(@color1, 40);
|
||||||
|
@accent: if(@light, darken(@color1, 10%), lighten(@color1, 40%));
|
||||||
|
|
||||||
--bg: @bg;
|
--bg: @bg;
|
||||||
--fg: @fg;
|
--fg: @fg;
|
||||||
--color1: hsl(hue(@bg), saturation(@bg) * @mult, lightness(@bg) * @mult);
|
--bg-sec: @bg-sec;
|
||||||
--color2: hsl(hue(@bg) + 40, saturation(@bg) * @mult, lightness(@bg) * @mult);
|
--accent: @accent;
|
||||||
--gradient: linear-gradient(135deg, var(--color1) 0%, var(--bg) 25%, var(--bg) 75%, var(--color2) 100%);
|
--color1: @color1;
|
||||||
|
--color2: @color2;
|
||||||
|
--gradient: linear-gradient(135deg, var(--color1) 0%, var(--color2) 100%);
|
||||||
|
--bg-gradient: linear-gradient(135deg, var(--color1) 0%, var(--bg) 25%, var(--bg) 75%, var(--color2) 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
|
|
@ -14,16 +14,18 @@
|
||||||
<span class="logo-text">Privacy</span>
|
<span class="logo-text">Privacy</span>
|
||||||
<span class="logo-hex icon"></span>
|
<span class="logo-hex icon"></span>
|
||||||
</div>
|
</div>
|
||||||
<form action="/goto" method="get">
|
<form action="/goto" method="get" class="flex-row">
|
||||||
<label>
|
<div class="search-box flex-row">
|
||||||
<input type="text" name="q" placeholder="Search query or URL">
|
<div class="search">
|
||||||
</label>
|
<input type="text" name="q" placeholder="Search query or URL">
|
||||||
<label class="input-clear">
|
</div>
|
||||||
<input type="reset">
|
<div class="search-clear">
|
||||||
</label>
|
<input type="reset" id="clear" class="icon" value="" aria-label="Clear">
|
||||||
<label class="input-submit">
|
</div>
|
||||||
<input type="submit">
|
</div>
|
||||||
</label>
|
<div class="search-submit">
|
||||||
|
<input type="submit" class="icon" value="" aria-label="Search">
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in a new issue