Scope CSS code (#10489)

- Fix #10470
- Fix scoped styles for GUI

# Important Notes
None
This commit is contained in:
somebody1234 2024-07-10 21:49:38 +10:00 committed by GitHub
parent 530d10d9bd
commit da6af3e896
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 85 additions and 93 deletions

View File

@ -104,4 +104,69 @@ registerAutoBlurHandler()
/* Compensate for top bar, render the app below it. */ /* Compensate for top bar, render the app below it. */
top: calc(var(--row-height) + var(--top-level-gap, 0px) + var(--top-bar-margin, 0px) + 16px); top: calc(var(--row-height) + var(--top-level-gap, 0px) + var(--top-bar-margin, 0px) + 16px);
} }
:deep(*),
:deep(*)::before,
:deep(*)::after {
box-sizing: border-box;
margin: 0;
}
:deep(.icon) {
width: 16px;
height: 16px;
}
/* Scrollbar style definitions for textual visualizations which need support for scrolling.
*
* The 11px width/height (depending on scrollbar orientation)
* is set so that it resembles macOS default scrollbar.
*/
:deep(.scrollable) {
scrollbar-color: rgba(190 190 190 / 50%) transparent;
}
:deep(.scrollable)::-webkit-scrollbar {
-webkit-appearance: none;
}
:deep(.scrollable)::-webkit-scrollbar-track {
-webkit-box-shadow: none;
}
:deep(.scrollable)::-webkit-scrollbar:vertical {
width: 11px;
}
:deep(.scrollable)::-webkit-scrollbar:horizontal {
height: 11px;
}
:deep(.scrollable)::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 1px solid rgba(220, 220, 220, 0.5);
background-color: rgba(190, 190, 190, 0.5);
}
:deep(.scrollable)::-webkit-scrollbar-corner {
background: rgba(0, 0, 0, 0);
}
:deep(.scrollable)::-webkit-scrollbar-button {
height: 8px;
width: 8px;
}
:deep(.draggable) {
cursor: grab;
}
:deep(.clickable) {
cursor: pointer;
}
:deep([data-use-vue-component-wrap]) {
display: contents !important;
}
</style> </style>

View File

@ -60,68 +60,3 @@
--right-dock-default-width: 40%; --right-dock-default-width: 40%;
--code-editor-default-height: 30%; --code-editor-default-height: 30%;
} }
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
}
.icon {
width: 16px;
height: 16px;
}
.hidden {
display: none;
}
/* Scrollbar style definitions for textual visualizations which need support for scrolling.
*
* The 11px width/height (depending on scrollbar orientation)
* is set so that it resembles macOS default scrollbar.
*/
.scrollable {
scrollbar-color: rgba(190 190 190 / 50%) transparent;
}
.scrollable::-webkit-scrollbar {
-webkit-appearance: none;
}
.scrollable::-webkit-scrollbar-track {
-webkit-box-shadow: none;
}
.scrollable::-webkit-scrollbar:vertical {
width: 11px;
}
.scrollable::-webkit-scrollbar:horizontal {
height: 11px;
}
.scrollable::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 1px solid rgba(220, 220, 220, 0.5);
background-color: rgba(190, 190, 190, 0.5);
}
.scrollable::-webkit-scrollbar-corner {
background: rgba(0, 0, 0, 0);
}
.scrollable::-webkit-scrollbar-button {
height: 8px;
width: 8px;
}
.draggable {
cursor: grab;
}
.clickable {
cursor: pointer;
}

View File

@ -1,10 +0,0 @@
@import './base.css';
body {
display: flex;
min-height: 100vh;
}
[data-use-vue-component-wrap] {
display: contents !important;
}

View File

@ -1,4 +1,4 @@
import '@/assets/main.css' import '@/assets/base.css'
export async function AsyncApp() { export async function AsyncApp() {
const [_, app] = await Promise.all([ const [_, app] = await Promise.all([

View File

@ -234,10 +234,8 @@ watchPostEffect(() => {
font-family: var(--font-mono); font-family: var(--font-mono);
font-size: 10px; font-size: 10px;
} }
</style>
<style> .label :deep(.domain) {
.HeatmapVisualization .label .domain {
display: none; display: none;
} }
</style> </style>

View File

@ -136,29 +136,27 @@ function renderRegularInterpolation(value: string, fgColor: RGBA, bgColor: RGBA)
.SQLVisualization { .SQLVisualization {
padding: 4px; padding: 4px;
} }
</style>
<style> :deep(.sql) {
.SQLVisualization .sql {
font-family: var(--font-mono); font-family: var(--font-mono);
font-size: 12px; font-size: 12px;
margin-left: 7px; margin-left: 7px;
margin-top: 5px; margin-top: 5px;
} }
.SQLVisualization .interpolation { :deep(.interpolation) {
border-radius: 6px; border-radius: 6px;
padding: 1px 2px 1px 2px; padding: 1px 2px 1px 2px;
display: inline; display: inline;
} }
.SQLVisualization .mismatch-parent { :deep(.mismatch-parent) {
position: relative; position: relative;
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
} }
.SQLVisualization .mismatch-mouse-area { :deep(.mismatch-mouse-area) {
display: inline; display: inline;
position: absolute; position: absolute;
width: 150%; width: 150%;
@ -167,15 +165,15 @@ function renderRegularInterpolation(value: string, fgColor: RGBA, bgColor: RGBA)
z-index: 0; z-index: 0;
} }
.SQLVisualization .mismatch { :deep(.mismatch) {
z-index: 1; z-index: 1;
} }
.SQLVisualization .modulepath { :deep(.modulepath) {
color: rgba(150, 150, 150, 0.9); color: rgba(150, 150, 150, 0.9);
} }
.SQLVisualization .tooltip { :deep(.tooltip) {
font-family: DejaVuSansMonoBook, sans-serif; font-family: DejaVuSansMonoBook, sans-serif;
font-size: 12px; font-size: 12px;
opacity: 0; opacity: 0;

View File

@ -684,18 +684,20 @@ onUnmounted(() => {
padding: 0 5px; padding: 0 5px;
overflow: hidden; overflow: hidden;
} }
</style>
<style> .TableVisualization > .ag-theme-alpine > :deep(.ag-root-wrapper.ag-layout-normal) {
.TableVisualization > .ag-theme-alpine > .ag-root-wrapper.ag-layout-normal {
border-radius: 0 0 var(--radius-default) var(--radius-default); border-radius: 0 0 var(--radius-default) var(--radius-default);
} }
a { /* Tag selectors are inefficient to compute, and should be replaced with a class selector
* if possible.
* See https://vuejs.org/api/sfc-css-features.html#scoped-style-tips */
:deep(a) {
color: blue; color: blue;
text-decoration: underline; text-decoration: underline;
} }
a:hover {
:deep(a):hover {
color: darkblue; color: darkblue;
} }
</style> </style>

View File

@ -24,4 +24,8 @@ const emit = defineEmits<{ 'update:modelValue': [modelValue: boolean] }>()
border-radius: var(--radius-full); border-radius: var(--radius-full);
background: var(--color-widget-selected); background: var(--color-widget-selected);
} }
.hidden {
display: none;
}
</style> </style>