diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index a94f76a023..3b60341a2c 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -451,6 +451,7 @@ a.no-line { .background-highlight-red { background-color: var(--highlight-red); } .background-button-bg-enabled { background-color: var(--theme-button-bg-enabled); } .background-menu-divider { background-color: var(--theme-menu-divider); } +.background-card-divider { background-color: var(--theme-card-divider); } .background-primary-color { background-color: var(--primary-button-enabled); } .background-bg-accent { background-color: var(--theme-bg-accent-color); } diff --git a/packages/theme/styles/common.scss b/packages/theme/styles/common.scss new file mode 100644 index 0000000000..4c24fa4a5c --- /dev/null +++ b/packages/theme/styles/common.scss @@ -0,0 +1,80 @@ +// +// Copyright © 2021 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* Panels */ +.antiPanel-application { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + min-width: 5rem; + width: 5rem; + height: 100%; + border-radius: 1.25rem; +} +.antiPanel-navigator, +.antiPanel-component { + flex-grow: 1; + display: flex; + flex-direction: column; + height: 100%; + border-radius: 1.25rem; + overflow: hidden; + + &.indent { margin-right: 1rem; } + &.filled { background-color: var(--theme-bg-color); } +} +.antiPanel-navigator { + min-width: 18rem; + max-width: 18rem; + width: 18rem; +} +.antiPanel-component { flex-grow: 1; } + +/* Navigation */ +.antiNav-divider { + flex-shrink: 0; + margin: 1.5rem 0; + height: 1px; + background-color: var(--theme-menu-divider); +} +.antiNav-scroll { + flex-grow: 1; + min-height: 0; + max-height: 10rem; + height: max-content; + overflow-x: hidden; + overflow-y: auto; + mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem); + + &::-webkit-scrollbar-track { margin: 0; } + &::-webkit-scrollbar-thumb { + background-color: var(--theme-bg-accent-color); + &:hover { background-color: var(--theme-menu-divider); } + } +} +.antiNav-box { + display: flex; + flex-direction: column; + height: 100%; +} +.antiNav-space { + flex-shrink: 0; + height: 1rem; +} +.antiNav-topFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } +.antiNav-bottomFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 2rem), rgba(0, 0, 0, 0) 100%); } +.antiNav-bothFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 2rem), rgba(0, 0, 0, 0) 100%); } +.antiNav-noneFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index 34bfb8af86..d11626f17a 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -90,174 +90,3 @@ } } .ac-column__list-item + .ac-column__list-item { margin-top: .75rem; } - -/* Popups */ -.antiPopup { - display: flex; - flex-direction: column; - min-height: 0; - background-color: var(--theme-button-bg-focused); - border: 1px solid var(--theme-button-border-enabled); - border-radius: .75rem; - box-shadow: 0px 10px 20px rgba(0, 0, 0, .2); - user-select: none; - - .ap-space { - flex-shrink: 0; - height: .5rem; - } - .ap-scroll { - flex-grow: 1; - margin: 0 .25rem; - min-height: 0; - overflow-x: hidden; - overflow-y: auto; - &::-webkit-scrollbar-track { margin: 0; } - &::-webkit-scrollbar-thumb { - background-color: var(--theme-bg-accent-color); - &:hover { background-color: var(--theme-menu-divider); } - } - } - .ap-box { - display: flex; - flex-direction: column; - padding: 0 .25rem; - height: 100%; - } - .ap-menuItem { - justify-content: start; - padding: .5rem; - color: var(--theme-content-color); - border-radius: .5rem; - text-align: left; - cursor: pointer; - - &.ap-woScroll { margin: 0 .5rem; } - &.selected { background-color: var(--theme-button-bg-hovered); } - &.empty { - display: flex; - justify-content: center; - font-style: italic; - color: var(--theme-content-trans-color); - cursor: default; - - &:hover { - color: var(--theme-content-trans-color); - background-color: transparent; - } - } - - &:hover { - color: var(--theme-caption-color); - background-color: var(--theme-button-bg-hovered); - } - &:focus { - color: var(--theme-content-accent-color); - background-color: var(--theme-button-bg-pressed); - z-index: 1; - } - } - .ap-check { - margin-left: 1rem; - width: 1rem; - height: 1rem; - } - - &-withHeader { - .ap-header { - flex-shrink: 0; - display: flex; - flex-direction: column; - margin: 0 .5rem; - text-align: left; - - .ap-caption { - margin: .5rem 0 0 .75rem; - font-size: .75rem; - font-weight: 600; - text-transform: uppercase; - color: var(--theme-content-dark-color); - } - } - } - - &-withTitle { - .ap-title { - flex-shrink: 0; - margin: 1rem 1rem .25rem; - font-weight: 500; - color: var(--theme-caption-color); - } - .ap-header { - margin: .25rem 1rem 0; - .ap-caption { - margin: .5rem 0 0 0; - } - } - } - - &-withCategory { - .ap-category { - flex-shrink: 0; - overflow-x: auto; - display: flex; - margin: 1rem 1rem .25rem; - - .ap-categoryItem { - margin: .25rem; - color: var(--theme-content-trans-color); - cursor: pointer; - - &.selected { color: var(--theme-caption-color); } - &:hover { color: var(--theme-content-accent-color); } - } - - &::-webkit-scrollbar:horizontal { height: .125rem; } - &::-webkit-scrollbar-thumb { background-color: var(--theme-button-bg-hovered); } - } - .ap-header { - margin: .25rem 1rem 0; - .ap-caption { - margin: .5rem 0 0 0; - } - } - } -} - -// .popup .tr-body:hover { background-color: transparent !important; } // Remove highlights table rows in popups - -/* Navigation */ -.antiNav-divider { - flex-shrink: 0; - margin: 1.5rem 0; - height: 1px; - background-color: var(--theme-menu-divider); -} -.antiNav-scroll { - flex-grow: 1; - min-height: 0; - max-height: 10rem; - height: max-content; - overflow-x: hidden; - overflow-y: auto; - mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem); - - &::-webkit-scrollbar-track { margin: 0; } - &::-webkit-scrollbar-thumb { - background-color: var(--theme-bg-accent-color); - &:hover { background-color: var(--theme-menu-divider); } - } -} -.antiNav-box { - display: flex; - flex-direction: column; - height: 100%; -} -.antiNav-space { - flex-shrink: 0; - height: 1rem; -} -.antiNav-topFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } -.antiNav-bottomFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 2rem), rgba(0, 0, 0, 0) 100%); } -.antiNav-bothFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 2rem), rgba(0, 0, 0, 0) 100%); } -.antiNav-noneFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } diff --git a/packages/theme/styles/global.scss b/packages/theme/styles/global.scss index b266ac3411..6296c430d8 100644 --- a/packages/theme/styles/global.scss +++ b/packages/theme/styles/global.scss @@ -15,7 +15,9 @@ @import "./_colors.scss"; @import "./_layouts.scss"; +@import "./common.scss"; @import "./components.scss"; +@import "./popups.scss"; @import "./mixins.scss"; @font-face { diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss new file mode 100644 index 0000000000..0d86720593 --- /dev/null +++ b/packages/theme/styles/popups.scss @@ -0,0 +1,151 @@ +// +// Copyright © 2021 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* Popups */ +.antiPopup { + display: flex; + flex-direction: column; + min-height: 0; + background-color: var(--theme-button-bg-focused); + border: 1px solid var(--theme-button-border-enabled); + border-radius: .75rem; + box-shadow: 0px 10px 20px rgba(0, 0, 0, .2); + user-select: none; + + .ap-space { + flex-shrink: 0; + height: .5rem; + } + .ap-scroll { + flex-grow: 1; + margin: 0 .25rem; + min-height: 0; + overflow-x: hidden; + overflow-y: auto; + &::-webkit-scrollbar-track { margin: 0; } + &::-webkit-scrollbar-thumb { + background-color: var(--theme-bg-accent-color); + &:hover { background-color: var(--theme-menu-divider); } + } + } + .ap-box { + display: flex; + flex-direction: column; + padding: 0 .25rem; + height: 100%; + } + .ap-menuItem { + justify-content: start; + padding: .5rem; + color: var(--theme-content-color); + border-radius: .5rem; + text-align: left; + cursor: pointer; + + &.ap-woScroll { margin: 0 .5rem; } + &.selected { background-color: var(--theme-button-bg-hovered); } + &.empty { + display: flex; + justify-content: center; + font-style: italic; + color: var(--theme-content-trans-color); + cursor: default; + + &:hover { + color: var(--theme-content-trans-color); + background-color: transparent; + } + } + + &:hover { + color: var(--theme-caption-color); + background-color: var(--theme-button-bg-hovered); + } + &:focus { + color: var(--theme-content-accent-color); + background-color: var(--theme-button-bg-pressed); + z-index: 1; + } + } + .ap-check { + margin-left: 1rem; + width: 1rem; + height: 1rem; + } + + &-withHeader { + .ap-header { + flex-shrink: 0; + display: flex; + flex-direction: column; + margin: 0 .5rem; + text-align: left; + + .ap-caption { + margin: .5rem 0 0 .75rem; + font-size: .75rem; + font-weight: 600; + text-transform: uppercase; + color: var(--theme-content-dark-color); + } + } + } + + &-withTitle { + .ap-title { + flex-shrink: 0; + margin: 1rem 1rem .25rem; + font-weight: 500; + color: var(--theme-caption-color); + } + .ap-header { + margin: .25rem 1rem 0; + .ap-caption { + margin: .5rem 0 0 0; + } + } + } + + &-withCategory { + .ap-category { + flex-shrink: 0; + overflow-x: auto; + display: flex; + margin: 1rem 1rem .25rem; + + .ap-categoryItem { + margin: .25rem; + color: var(--theme-content-trans-color); + cursor: pointer; + + &.selected { color: var(--theme-caption-color); } + &:hover { color: var(--theme-content-accent-color); } + } + + &::-webkit-scrollbar:horizontal { height: .125rem; } + &::-webkit-scrollbar-thumb { background-color: var(--theme-button-bg-hovered); } + } + .ap-header { + margin: .25rem 1rem 0; + .ap-caption { + margin: .5rem 0 0 0; + } + } + } +} + +// Remove highlights table rows and hide dots in popups +.popup .tr-body:hover, .popup-tooltip .tr-body:hover { background-color: transparent !important; } +.popup-tooltip .tr-body .menuRow { visibility: hidden !important; } diff --git a/packages/ui/src/components/TooltipInstance.svelte b/packages/ui/src/components/TooltipInstance.svelte index 18ee7526b2..30ff50b423 100644 --- a/packages/ui/src/components/TooltipInstance.svelte +++ b/packages/ui/src/components/TooltipInstance.svelte @@ -145,8 +145,8 @@ {#if $tooltip.component} -