Compare commits

...
Author SHA1 Message Date
zsviczian 7bfedba45d Merge pull request #2708 from heinrich26/improve-dom-layout
Improve dom layout
2026-03-15 12:28:21 +01:00
Hendrik Horstmann f212db7223 Merge pull request #1 from zsviczian/master
bump
2026-03-14 23:09:37 +01:00
Hendrik Horstmann 2cd9119ad1 Merge branch 'master' into improve-dom-layout 2026-03-09 13:11:16 +01:00
henrich26 75a0af8ee4 added a rule to stop the undo/redo buttons from wrapping 2026-03-08 22:01:41 +01:00
henrich26 b32de61199 Layout and style improvements to sidebar-menu
* Remove an unnecessary container around the tray icons (to make 3rd party styling more pleasant)
* fix the positioning of the sidebar (reverted to using the upstream solution with `--editor-container-padding` and removed the overriden styles).
* removed an extra gap from the sidebar/tray icons while in "compact" mode (which made it _less compact_).
* styled the Library-Button to look like it's siblings.
2026-03-04 15:43:53 +01:00
henrich26 ece9a9d064 Remove unnecessary Band-Aid and improve sidepanel styling
* removed an unnecessary Band-Aid that would dictate the width of the _undo/redo buttons_ (which is not in base-excalidraw) and added a new rule to fix their appearance in `tray-mode` (there was some whitespace). I double-checked all the UI-modes and didn't spot any issues.
* updated the styling of the Sidepanel top-bar – now using a more "Obsidian-esque" icon-button and switched to Obsidian-lengths for those elements. Styles no longer needed were removed.
2026-03-04 15:43:52 +01:00
2 changed files with 48 additions and 64 deletions

No files matched your search

+5 -10
View File
@@ -270,12 +270,7 @@ export class ObsidianMenu {
public renderButton (isMobile: boolean, appState: AppState) {
const isFullscreen = this.view.isFullscreen();
return (
<div className={clsx(
{
"ExcalidrawObsidianMenu--mobile": isMobile,
"ExcalidrawObsidianMenu": !isMobile,
},
)}>
<>
<label
className={clsx(
"ToolIcon",
@@ -284,7 +279,7 @@ export class ObsidianMenu {
"is-mobile": isMobile,
},
)}
onClick={this.actionShowHideMenu.bind(this,isMobile,appState)}
onClick={this.actionShowHideMenu.bind(this, isMobile, appState)}
>
<div className="ToolIcon__icon" aria-label={t("OBSIDIAN_TOOLS_PANEL")}>
{ICONS.obsidian}
@@ -318,9 +313,9 @@ export class ObsidianMenu {
{isFullscreen ? ICONS.exitFullScreen : ICONS.gotoFullScreen}
</div>
</label>
{this.renderCustomPens(isMobile,appState)}
{this.renderPinnedScriptButtons(isMobile,appState)}
</div>
{this.renderCustomPens(isMobile, appState)}
{this.renderPinnedScriptButtons(isMobile, appState)}
</>
);
};
+43 -54
View File
@@ -188,7 +188,7 @@ li[data-testid] {
}
.excalidraw-dirty {
color: red;
color: var(--text-error);
}
.workspace-leaf-content .excalidraw-view {
@@ -321,6 +321,7 @@ textarea.excalidraw-wysiwyg {
--default-icon-size: 1rem !important;
--lg-button-size: 1.8rem !important;
--lg-icon-size: 1rem !important;
--editor-container-padding: var(--size-4-2);
}
.excalidraw .tray-zoom {
@@ -330,7 +331,7 @@ textarea.excalidraw-wysiwyg {
padding-top: 0.05rem;
}
.excalidraw-container.theme--dark {
.excalidraw-container.theme--dark { /* unused */
background-color: #121212;
color: #fff;
}
@@ -345,10 +346,6 @@ textarea.excalidraw-wysiwyg {
max-height: 10rem;
}
.excalidraw .FixedSideContainer_side_top {
top: 0.3rem;
}
.excalidraw .ToolIcon__keybinding {
font-size: 0.45rem !important;
}
@@ -363,13 +360,6 @@ label.color-input-container > input {
max-width: 5rem;
}
.excalidraw .FixedSideContainer_side_top {
left: 10px !important;
top: 10px !important;
right: 10px;
bottom: 10px !important;
}
.excalidraw-hidden {
display: none !important;
}
@@ -394,10 +384,6 @@ label.color-input-container > input {
max-width: 13rem;
}
.excalidraw button {
width: initial;
}
.excalidraw input[type="color"] {
width: 1.65rem;
height: 1.65rem;
@@ -431,6 +417,26 @@ div.excalidraw-draginfo {
position: absolute !important;
}
/* In Obsidian-Excalidraw, the Sidebar-Trigger is sometimes in a Container/
Island, so it shall be styled like any other of its .ToolIcon siblings */
.excalidraw :where(.mobile-misc-tools-container, .tray-misc-tools-container) .sidebar-trigger {
background-color: unset;
border-radius: 0;
box-shadow: none;
/* this appears to me as the least impactful way of undoing the upstream mess */
--lg-button-size: var(--button-height, var(--default-button-size));
&:hover {
background-color: var(--button-hover-bg);
}
&:active {
background-color: var(--button-hover-bg);
box-shadow: none;
border: 1px solid var(--button-active-border);
}
}
.excalidraw-sidepanel-container {
height: 100%;
}
@@ -445,8 +451,8 @@ div.excalidraw-draginfo {
.excalidraw-sidepanel__controls {
display: flex;
align-items: center;
gap: 0.35rem;
padding: 0.35rem 0.5rem;
gap: var(--size-4-1);
padding: var(--size-4-2) var(--size-4-2);
border-bottom: 1px solid var(--divider-color, var(--background-modifier-border));
background-color: var(--background-secondary);
}
@@ -455,28 +461,6 @@ div.excalidraw-draginfo {
flex: 1;
}
.excalidraw-sidepanel__close-button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 2.6rem;
border: 1px solid var(--divider-color, var(--background-modifier-border));
border-radius: 0.55rem;
background: var(--background-primary);
color: var(--text-normal);
padding: 0 !important;
transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.excalidraw-sidepanel__close-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.excalidraw-sidepanel__close-button:hover:not(:disabled) {
background: var(--background-modifier-hover);
}
.excalidraw-sidepanel__empty {
padding: 0.75rem;
color: var(--text-muted);
@@ -516,7 +500,7 @@ div.excalidraw-draginfo {
padding: 0.5rem;
}
.excalidraw-sidepanel-tab__button {
.excalidraw-sidepanel-tab__button { /* probably unused */
display: inline-flex;
align-items: center;
gap: 0.35rem;
@@ -1062,20 +1046,23 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
z-index: 9999;
}
.excalidraw .undo-redo-buttons button {
width: 3em;
}
.excalidraw--tray .App-bottom-bar > .Island > .App-toolbar > .App-toolbar-content {
/* This will render the undo/redo buttons as if they weren't
in a separate container, but simply part of the row */
> :not([class]) {
display: contents;
}
.ExcalidrawObsidianMenu--mobile label.ToolIcon {
margin-left: 4px;
> .ToolIcon__icon:empty {
display: none;
}
}
.excalidraw .excalidraw-ui-top-right.library-and-pen,
.ExcalidrawObsidianMenu--mobile {
display: flex;
.excalidraw.excalidraw--mobile .excalidraw-ui-top-right {
flex-direction: row;
flex-wrap: wrap;
row-gap: 4px;
gap: var(--size-4-1);
justify-content: center;
align-items: center;
}
@@ -1084,14 +1071,16 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
margin: auto;
}
.ExcalidrawObsidianMenu {
display: flex;
flex-direction: column;
.excalidraw :is(.mobile-misc-tools-container, .tray-misc-tools-container) {
margin-right: unset;
&.layer-ui__wrapper__top-right--compact {
gap: 0; /* there shouldn't be a larger gap in a "compact" mode */
}
}
.excalidraw .FixedSideContainer_side_top {
padding-top: 0 !important;
}
.excalidraw .ToolIcon.ToolIcon__penMode {