debian-mirror-gitlab/app/assets/stylesheets/components/upload_dropzone/upload_dropzone.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.6 KiB
SCSS
Raw Normal View History

2022-07-23 23:45:48 +05:30
@function encodecolor($string) {
@if type-of($string) == 'color' {
$hex: str-slice(ie-hex-str($string), 4);
$string: unquote('#{$hex}');
}
$string: '%23' + $string;
@return $string;
}
@mixin dropzone-background($stroke-color, $stroke-width: 4, $stroke-linecap: 'butt') {
background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='#{encodecolor($stroke-color)}' stroke-width='#{$stroke-width}' stroke-dasharray='6%2c4' stroke-dashoffset='0' stroke-linecap='#{encodecolor($stroke-linecap)}'/%3e%3c/svg%3e");
}
2021-01-29 00:20:46 +05:30
.upload-dropzone-border {
2022-07-23 23:45:48 +05:30
border: 0;
@include dropzone-background($gray-400, 2, 'round');
border-radius: 8px;
2021-01-29 00:20:46 +05:30
}
.upload-dropzone-card {
2022-07-23 23:45:48 +05:30
transition: background $gl-transition-duration-medium $general-hover-transition-curve,
border $gl-transition-duration-medium $general-hover-transition-curve;
2021-01-29 00:20:46 +05:30
color: $gl-text-color;
2022-07-23 23:45:48 +05:30
&:hover,
2021-01-29 00:20:46 +05:30
&:focus,
2022-07-23 23:45:48 +05:30
&:focus-within,
2021-01-29 00:20:46 +05:30
&:active {
outline: none;
2022-07-23 23:45:48 +05:30
@include dropzone-background($blue-500);
2021-01-29 00:20:46 +05:30
color: $gl-text-color;
}
2022-07-23 23:45:48 +05:30
&:focus,
&:focus-within,
&:active {
@include gl-focus;
}
2021-01-29 00:20:46 +05:30
&:hover {
border-color: $gray-300;
}
}
.upload-dropzone-overlay {
2022-07-23 23:45:48 +05:30
background-color: $blue-50;
@include dropzone-background($blue-500);
2021-01-29 00:20:46 +05:30
top: 0;
left: 0;
pointer-events: none;
opacity: 1;
}
.upload-dropzone-fade-enter-active,
.upload-dropzone-fade-leave-active {
transition: opacity $general-hover-transition-duration $general-hover-transition-curve;
}
.upload-dropzone-fade-enter,
.upload-dropzone-fade-leave-to {
opacity: 0;
}