signal-desktop/stylesheets/components/PlaybackButton.scss

91 lines
2 KiB
SCSS
Raw Normal View History

2023-03-02 20:55:40 +00:00
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2024-11-15 23:09:31 +00:00
@use '../mixins';
@use '../variables';
@use 'MessageAudio';
2023-03-02 20:55:40 +00:00
.PlaybackButton {
2024-11-15 23:09:31 +00:00
@include mixins.button-reset;
2023-03-02 20:55:40 +00:00
2024-11-15 23:09:31 +00:00
& {
flex-shrink: 0;
margin-inline-end: MessageAudio.$audio-attachment-button-margin-big;
2023-03-02 20:55:40 +00:00
2024-11-15 23:09:31 +00:00
outline: none;
border-radius: 18px;
}
2023-03-02 20:55:40 +00:00
&::before {
display: block;
height: 100%;
content: '';
}
@mixin audio-icon($name, $icon, $color) {
&.PlaybackButton--#{$name}::before {
2024-11-15 23:09:31 +00:00
@include mixins.color-svg('../images/icons/#{$icon}.svg', $color, false);
2023-03-02 20:55:40 +00:00
}
}
@mixin all-audio-icons($color) {
2023-05-04 18:04:22 +00:00
@include audio-icon(play, v3/play/play-fill, $color);
@include audio-icon(pause, v3/pause/pause-fill, $color);
@include audio-icon(download, v3/arrow/arrow-down, $color);
@include audio-icon(pending, v2/audio-spinner-arc-22, $color);
2023-03-02 20:55:40 +00:00
}
&--variant-message {
2024-11-15 23:09:31 +00:00
width: MessageAudio.$audio-attachment-button-size;
height: MessageAudio.$audio-attachment-button-size;
2023-03-02 20:55:40 +00:00
}
&--variant-mini {
&::before {
-webkit-mask-size: 100% !important;
}
width: 14px;
height: 14px;
}
&--variant-draft {
&::before {
-webkit-mask-size: 100% !important;
}
width: 18px;
height: 18px;
}
&--pending {
cursor: auto;
}
&--pending::before {
animation: rotate 1000ms linear infinite;
}
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
2023-03-02 20:55:40 +00:00
&--context-incoming {
&.PlaybackButton--variant-message {
2024-11-15 23:09:31 +00:00
background: variables.$color-white;
2023-03-02 20:55:40 +00:00
}
}
2024-11-15 23:09:31 +00:00
@include all-audio-icons(variables.$color-gray-60);
2023-03-02 20:55:40 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
2023-03-02 20:55:40 +00:00
&--context-incoming {
&.PlaybackButton--variant-message {
2024-11-15 23:09:31 +00:00
background: variables.$color-gray-60;
2023-03-02 20:55:40 +00:00
}
}
2024-11-15 23:09:31 +00:00
@include all-audio-icons(variables.$color-gray-15);
2023-03-02 20:55:40 +00:00
}
&--context-outgoing {
&.PlaybackButton--variant-message {
2024-11-15 23:09:31 +00:00
background: variables.$color-white-alpha-20;
2023-03-02 20:55:40 +00:00
}
2024-11-15 23:09:31 +00:00
@include all-audio-icons(variables.$color-white);
2023-03-02 20:55:40 +00:00
}
}