adding css variables for better customization

This commit is contained in:
nek0 2017-10-08 20:29:40 +02:00
parent 0cd37de19c
commit 523db60ebf
3 changed files with 91 additions and 14 deletions

View file

@ -117,7 +117,6 @@ renderLayout widget = do
] ]
mapM_ addStylesheet $ map StaticR mapM_ addStylesheet $ map StaticR
[ css_bootstrap_min_css [ css_bootstrap_min_css
, css_dropdown_css
, css_main_css , css_main_css
] ]
$(widgetFile "default-layout") $(widgetFile "default-layout")

View file

@ -1,5 +1,5 @@
name: eidolon name: eidolon
version: 0.1.11.1 version: 0.1.11.2
synopsis: Image gallery in Yesod synopsis: Image gallery in Yesod
homepage: https://eidolon.nek0.eu homepage: https://eidolon.nek0.eu
license: AGPL-3 license: AGPL-3

View file

@ -1,3 +1,11 @@
:root {
--text-color: white;
--inverted-text-color: rgba(0,0,0,0.7);
--theme-color: #d64760;
--inverted-theme-color: white;
--message-background-color: lightyellow;
}
body { body {
display: flex; display: flex;
min-height: 100vh; min-height: 100vh;
@ -13,7 +21,7 @@ body {
} }
a { a {
color: white; color: var(--text-color);
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
transition: color 0.25s ease-in-out; transition: color 0.25s ease-in-out;
@ -25,8 +33,8 @@ a figcaption {
transition: color 0.25s ease-in-out; transition: color 0.25s ease-in-out;
} }
a:hover, .item a:hover, .medium a:hover, a:hover figcaption { a:hover, .item a:hover, .medium a:hover, a:hover figcaption, .loginDiv a:hover {
color: #d64760; color: var(--theme-color);
text-decoration: underline; text-decoration: underline;
transition: color 0.25s ease-in-out; transition: color 0.25s ease-in-out;
} }
@ -37,8 +45,8 @@ a:hover, .item a:hover, .medium a:hover, a:hover figcaption {
#message { #message {
padding: 1em 2em; padding: 1em 2em;
background: lightyellow url('../img/overlay.png'); background: var(--message-background-color) url('../img/overlay.png');
color: #d64760; color: var(--theme-color);
font-size: 1.5em; font-size: 1.5em;
position:relative; position:relative;
top: 80px; top: 80px;
@ -57,17 +65,21 @@ a:hover, .item a:hover, .medium a:hover, a:hover figcaption {
text-align: center; text-align: center;
} }
.item, .medium, .loginDiv, .newaccount, .reactivate { .item, .medium, .loginDiv, .newaccount, .reactivate, .password {
color: rgba(0,0,0,0.7); color: var(--inverted-text-color);
display: inline-block; display: inline-block;
position: relative; position: relative;
background: rgba(255,255,255,0.8) url('../img/overlay.png'); background: rgba(255,255,255,0.8) url('../img/overlay.png');
border: 10px solid white; border: 10px solid var(--inverted-theme-color);
padding-top: 0; padding-top: 0;
padding-left: 0; padding-left: 0;
vertical-align: middle; vertical-align: middle;
} }
.loginDiv a {
color: var(--inverted-text-color);
}
.item { .item {
height: 300px; height: 300px;
width: 400px; width: 400px;
@ -83,7 +95,7 @@ a:hover, .item a:hover, .medium a:hover, a:hover figcaption {
} }
.subheader { .subheader {
background: rgba(214, 71, 96, 0.7) url('../img/overlay.png'); background: var(--theme-color) url('../img/overlay.png');
display: inline-flex; display: inline-flex;
flex-direction: column; flex-direction: column;
} }
@ -108,7 +120,7 @@ a:hover, .item a:hover, .medium a:hover, a:hover figcaption {
} }
.subheader a:hover { .subheader a:hover {
color: white; color: var(--text-color);
} }
.subheader p { .subheader p {
@ -173,7 +185,7 @@ img {
nav { nav {
width: 100%; width: 100%;
padding: 1em 2em; padding: 1em 2em;
background: #d64760 url('../img/overlay.png'); background: var(--theme-color) url('../img/overlay.png');
position: fixed; position: fixed;
z-index: 6; z-index: 6;
} }
@ -259,7 +271,7 @@ ul, ol {
} }
.item, .medium { .item, .medium {
border: 1px solid white; border: 1px solid var(--inverted-theme-color);
} }
.item { .item {
@ -270,3 +282,69 @@ ul, ol {
min-width: 100%; min-width: 100%;
} }
} }
#user-nav {
list-style: none;
font-weight: bold;
position: relative;
padding: 0;
}
#user-nav ul {
display: none;
position: absolute;
}
#user-nav li {
margin: 0 0 0 0;
}
#user-nav > li {
margin-right: 20px;
}
#user-nav li a {
padding: 10px 20px 10px;
border-radius: 5px;
background: white url('../img/overlay.png');
}
#user-nav li ul {
padding: 0;
}
#user-nav li ul li {
display: inline;
}
#user-nav input[type="checkbox"]:checked + ul {
display: block;
background-color: white;
border-radius: 5px;
z-index: 99;
}
#user-nav a {
display: block;
text-decoration: none;
color: var(--theme-color);
}
#user-nav a:hover {
color: black;
transition-timing-function: linear
transition-duration: 0.25s;
}
#user-nav label {
margin: 0;
}
.vanish {
/*position: absolute;
left: -9999px;*/
display: none;
}
.red {
background: rgba(255,0,0,0.2) url('../img/overlay.png') !important;
}