kcalculator/style.css

223 lines
3.5 KiB
CSS
Raw Normal View History

2022-09-08 22:55:43 +02:00
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url("/icons.ttf");
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url("/icons.ttf") format('truetype');
}
.material-icons {
transform: translateY(0.1em);
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 1em; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
user-select: none;
/* Support for all WebKit browsers. */
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
* {
margin: 0;
padding: 0;
}
html, body {
min-height: 100vh;
font-size: 100%;
}
header {
font-size: 1.5rem;
line-height: 5em;
text-align: center;
background-color: #add8e6;
color: #333;
}
#food-search-container {
margin: 1em;
text-align: center;
}
#food-search {
margin-bottom: 0.25em;
border: 1px solid darkgray;
border-radius: 0.15em;
padding: 0.25em;
outline: 0;
box-sizing: border-box;
width: 20rem;
max-width: 100%;
}
#search-entries {
margin: 0 auto;
max-width: 100%;
display: flex;
flex-wrap: wrap;
gap: 0.25em;
justify-content: center;
}
.search-entry {
background-color: #eee;
border: 1px solid darkgray;
padding: 0.15em;
border-radius: 0.15em;
cursor: pointer;
transition: all 0.25s ease-in-out;
}
.search-entry:hover {
background-color: #ddd;
transition: all 0.25s ease-in-out;
}
#food-menu,
#summary {
width: 60em;
max-width: 100%;
margin: 0 auto;
}
.menu-item {
padding: 0.5em;
box-sizing: border-box;
}
.menu-item:not(:last-child) {
border-bottom: 1px solid lightgray;
}
.delete-menu-item,
.summary-delete-icon {
display: block;
float: right;
color: #cc3d3d;
width: 1.5em;
height: 1.5em;
text-align: center;
cursor: pointer;
transition: all 0.25s ease-in-out;
}
.delete-menu-item:hover,
.delete-menu-item:focus {
scale: 1.5;
transition: all 0.25s ease-in-out;
}
.menu-item-kcal {
color: darkgray;
font-size: 0.65em;
transform: translateY(-0.15em);
display: inline-block;
}
.menu-item-amount-container,
.summary-amount-container {
float: right;
margin-right: 0.2em;
}
.menu-item-amount,
.summary-amount {
font-size: 1rem;
border: 1px solid lightgray;
box-sizing: border-box;
outline: 0;
width: 3em;
text-align: right;
margin-left: 0.3em;
border-radius: 0.2em;
}
.menu-item-unit,
.summary-unit {
display: inline-block;
margin-left: 0.2em;
min-width: 1.5em;
transform: translateX(-0.1em);
}
.menu-item-amount:hover,
.menu-item-amount:focus {
border: 1px solid darkgray;
}
.menu-item-amount:invalid {
border: 1px solid red;
}
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
@keyframes highlight {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
.menu-item-kcal-unit,
.summary-kcal-unit {
margin-right: 0.25em;
}
.menu-item-kcal-for-amount,
.menu-item-kcal-unit {
color: #555;
}
#summary {
border-top: 1px solid black;
padding: 0.5em;
box-sizing: border-box;
}
.summary-amount,
.summary-unit,
.summary-delete-icon,
.summary-kcal-unit-sep {
visibility: hidden;
}
.summary-kcal,
.summary-kcal-unit,
.summary-name {
display: inline;
font-weight: bold;
}