eruda3 / src /style /mixin.scss
soiz1's picture
Migrated from GitHub
271613e verified
@use './variable' as *;
@mixin absolute($width: 100%, $height: 100%) {
position: absolute;
width: $width;
height: $height;
left: 0;
top: 0;
}
@mixin overflow-auto($direction: 'both') {
@if $direction == 'both' {
overflow: auto;
} @else {
overflow-#{$direction}: auto;
}
-webkit-overflow-scrolling: touch;
}
@mixin safe-area($prop, $value, $pos: 'bottom') {
#{$prop}: calc(#{$value} + env(safe-area-inset-#{$pos}));
}
@mixin breadcrumb {
background: var(--darker-background);
color: var(--primary);
user-select: text;
margin-bottom: 10px;
word-break: break-all;
padding: $padding;
font-size: $font-size-l;
min-height: 40px;
border-bottom: 1px solid var(--border);
}
@mixin control {
@include absolute(100%, 40px);
cursor: default;
font-size: 0;
background: var(--darker-background);
color: var(--primary);
line-height: 20px;
border-bottom: 1px solid var(--border);
[class^='eruda-icon-'],
[class*=' icon-'] {
display: inline-block;
padding: 10px;
font-size: $font-size-l;
position: absolute;
top: 0;
cursor: pointer;
transition: color $anim-duration;
&:active,
&.active {
color: var(--accent);
}
}
}
@mixin clear-float {
&:after {
content: '';
display: block;
clear: both;
}
}
@mixin right-btn {
.btn {
margin-left: 5px;
float: right;
color: var(--primary);
width: 18px;
height: 18px;
font-size: $font-size-l;
cursor: pointer;
transition: color $anim-duration;
&.filter-text {
width: auto;
max-width: 80px;
font-size: $font-size;
overflow: hidden;
font-weight: normal;
text-overflow: ellipsis;
display: inline-block;
}
&:active {
color: var(--accent);
}
&.btn-disabled {
color: inherit !important;
cursor: default !important;
pointer-events: none;
opacity: 0.5;
* {
pointer-events: none;
}
}
}
}