livebook/assets/css/js_interop.css
Jannik Becher 336ae74fb6
Add keyboard shortcut for collapse/expand section (#1779)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2023-03-13 22:37:11 +01:00

315 lines
7.8 KiB
CSS

/*
Conditional elements display.
Verious hooks and callbacks dynamically set attributes
based on which we hide/show certain elements.
This way we don't have to engage the server in
solely client-side operations.
*/
/* === Global === */
[phx-hook="Highlight"][data-highlighted] > [data-source] {
@apply hidden;
}
[phx-hook="Dropzone"][data-js-dragging] {
@apply bg-yellow-100 border-yellow-300;
}
/* === Session === */
[data-el-session]:not([data-js-insert-mode]) [data-el-insert-mode-indicator] {
@apply invisible;
}
[data-el-session]:not([data-js-insert-mode])
[data-el-cell][data-type="markdown"]
[data-el-editor-box],
[data-el-session][data-js-insert-mode]
[data-el-cell][data-type="markdown"]:not([data-js-focused])
[data-el-editor-box] {
@apply hidden;
}
[data-el-session][data-js-insert-mode]
[data-el-cell][data-js-focused]
[data-el-enable-insert-mode-button] {
@apply hidden;
}
[data-el-session]:not([data-js-insert-mode])
[data-el-cell][data-type="markdown"][data-js-focused]
[data-el-insert-image-button] {
@apply hidden;
}
[data-el-notebook-headline]:hover [data-el-heading],
[data-el-section-headline]:hover [data-el-heading] {
@apply border-blue-200;
}
[data-el-notebook-headline][data-js-focused] [data-el-heading],
[data-el-section-headline][data-js-focused] [data-el-heading] {
@apply border-blue-300;
}
[data-el-section-headline]:not(:hover):not([data-js-focused])
[data-el-heading]
+ [data-el-section-actions]:not(:focus-within) {
@apply hidden;
}
[data-el-section][data-js-collapsed] [data-el-section-collapse-button],
[data-el-section]:not([data-js-collapsed])
[data-el-section-headline]:not(:hover):not([data-js-focused])
[data-el-section-collapse-button],
[data-el-section]:not([data-js-collapsed]) [data-el-section-expand-button],
[data-el-session]:not([data-js-code-zen])
[data-el-section][data-js-collapsed]
> [data-el-section-content],
[data-el-section]:not([data-js-collapsed])
> [data-el-section-subheadline-collapsed] {
@apply hidden;
}
[data-el-cell][data-js-focused] {
@apply border-blue-300 border-opacity-100;
}
[data-el-cell]:not([data-js-focused]) [data-el-actions]:not(:focus-within) {
/* Note: using opacity, so the buttons are focusable (via tab navigation)
and when focused we show the actions back. */
@apply opacity-0;
}
[data-el-cell]:not([data-js-focused])
[data-el-actions]:not([data-primary]):not(:focus-within) {
@apply pointer-events-none;
}
[data-el-cell]:not([data-js-focused])[data-js-hover]
[data-el-actions][data-primary] {
@apply opacity-100 pointer-events-auto;
}
[data-el-cell][data-js-changed] [data-el-cell-status] {
@apply italic;
}
[data-el-cell]:not([data-js-changed])
[data-el-cell-status]
[data-el-change-indicator] {
@apply invisible;
}
[data-el-sections-list-item][data-js-is-viewed] {
@apply text-gray-900;
}
[data-el-cell]:not([data-js-focused])[data-js-hover]
[data-el-cell-focus-indicator] {
@apply bg-blue-200;
}
[data-el-cell][data-js-focused] [data-el-cell-focus-indicator] {
@apply bg-blue-300;
}
[data-el-cell][data-js-amplified] [data-el-outputs-container] {
@apply bg-white m-0 py-16;
width: 90vw;
position: relative;
left: calc(-45vw + 50%);
}
[data-el-cell][data-js-amplified]
[data-el-amplify-outputs-button]
.icon-button {
@apply bg-gray-100 text-gray-900;
}
[data-el-cell][data-type="smart"]:not([data-js-source-visible])
[data-el-editor-box] {
/* Note: we intentionally don't hide the editor, because this leads
to issues with hover intellisense once the editor is shown. */
@apply h-0 overflow-hidden;
}
[data-el-cell][data-type="smart"][data-js-source-visible] [data-el-ui-box] {
@apply hidden;
}
[data-el-session]
[data-el-cell][data-type="setup"]:not(
[data-eval-validity="fresh"]:not([data-js-empty])
):not([data-eval-errored]):not([data-js-changed]):not([data-js-focused])
[data-el-editor-box] {
@apply h-0 overflow-hidden;
}
[data-el-session]
[data-el-cell][data-type="setup"][data-js-focused]
[data-el-info-box],
[data-el-session]
[data-el-cell][data-type="setup"][data-eval-validity="fresh"]:not(
[data-js-empty]
)
[data-el-info-box],
[data-el-session]
[data-el-cell][data-type="setup"][data-eval-errored]
[data-el-info-box],
[data-el-session]
[data-el-cell][data-type="setup"][data-js-changed]
[data-el-info-box] {
@apply hidden;
}
[data-el-cell][data-type="smart"][data-js-source-visible]
[data-el-toggle-source-button]
.icon-button {
@apply bg-gray-100 text-gray-900;
}
[data-el-cell][data-type="smart"][data-js-source-visible]
[data-el-cell-status-container] {
@apply absolute bottom-2 right-2;
}
[data-el-output][data-border] {
@apply p-4 border border-t-0 border-gray-200 divide-y divide-gray-200;
}
[data-el-output][data-border]:first-child {
@apply rounded-t-lg border-t;
}
[data-el-output]:not([data-border]) + [data-el-output][data-border] {
@apply border-t;
}
[data-el-output][data-border]:last-child {
@apply rounded-b-lg border-b;
}
[data-el-output]:not(:first-child) {
@apply mt-2;
}
[data-el-output][data-border] + [data-el-output][data-border] {
@apply mt-0;
}
[data-el-outputs-container] > [data-el-output]:first-child {
@apply mt-2;
}
[data-el-session]:not([data-js-side-panel-content]) [data-el-side-panel] {
@apply hidden;
}
[data-el-session]:not([data-js-side-panel-content="sections-list"])
[data-el-sections-list] {
@apply hidden;
}
[data-el-session]:not([data-js-side-panel-content="clients-list"])
[data-el-clients-list] {
@apply hidden;
}
[data-el-session]:not([data-js-side-panel-content="secrets-list"])
[data-el-secrets-list] {
@apply hidden;
}
[data-el-session]:not([data-js-side-panel-content="runtime-info"])
[data-el-runtime-info] {
@apply hidden;
}
[data-el-session]:not([data-js-side-panel-content="app-info"])
[data-el-app-info] {
@apply hidden;
}
[data-el-session][data-js-side-panel-content="sections-list"]
[data-el-sections-list-toggle] {
@apply text-gray-50 bg-gray-700;
}
[data-el-session][data-js-side-panel-content="clients-list"]
[data-el-clients-list-toggle] {
@apply text-gray-50 bg-gray-700;
}
[data-el-session][data-js-side-panel-content="secrets-list"]
[data-el-secrets-list-toggle] {
@apply text-gray-50 bg-gray-700;
}
[data-el-session][data-js-side-panel-content="runtime-info"]
[data-el-runtime-info-toggle] {
@apply text-gray-50 bg-gray-700;
}
[data-el-session][data-js-side-panel-content="app-info"]
[data-el-app-info-toggle] {
@apply text-gray-50 bg-gray-700;
}
[data-el-session][data-js-side-panel-content="app-info"]
[data-el-app-indicator] {
@apply border-gray-700;
}
[data-el-clients-list-item]:not([data-js-followed]) [data-meta="unfollow"] {
@apply hidden;
}
[data-el-clients-list-item][data-js-followed] [data-meta="follow"] {
@apply hidden;
}
[phx-hook="VirtualizedLines"]:not(:hover) [data-el-clipcopy] {
@apply hidden;
}
[data-el-session][data-js-code-zen] [data-el-section-headline],
[data-el-session][data-js-code-zen] [data-el-section-subheadline],
[data-el-session][data-js-code-zen] [data-el-section-subheadline-collapsed],
[data-el-session][data-js-code-zen] [data-el-cell][data-type="markdown"],
[data-el-session][data-js-code-zen] [data-el-actions],
[data-el-session][data-js-code-zen] [data-el-insert-buttons] {
@apply hidden;
}
[data-el-session][data-js-code-zen] [data-el-sections-container] {
@apply space-y-0 mt-0;
}
[data-el-session][data-js-code-zen][data-js-no-outputs]
[data-el-outputs-container] {
@apply hidden;
}
[data-el-session][data-js-code-zen][data-js-no-outputs]
[data-el-code-zen-outputs-toggle]
[data-label-hide] {
@apply hidden;
}
[data-el-session][data-js-code-zen]:not([data-js-no-outputs])
[data-el-code-zen-outputs-toggle]
[data-label-show] {
@apply hidden;
}
[data-el-session][data-js-code-zen] [data-el-code-zen-enable] {
@apply hidden;
}
[data-el-session]:not([data-js-code-zen]) [data-el-focus-mode-options] {
@apply hidden;
}