From cc2d1a26e2ca63714abc1a36593aba72181090c8 Mon Sep 17 00:00:00 2001 From: Davinder Singh Date: Fri, 24 Feb 2023 11:15:41 +0000 Subject: [PATCH] Merge pull request #11958 from overleaf/ds-td-documentation-btn-refactor Styling and HTML structure of the documentation button GitOrigin-RevId: e643edbe05579c037ca1ec27fab765974e74d2c5 --- .../components/documentation-button.tsx | 50 ++++++++----------- .../stylesheets/app/editor/outline.less | 33 ++++++------ 2 files changed, 39 insertions(+), 44 deletions(-) diff --git a/services/web/frontend/js/features/outline/components/documentation-button.tsx b/services/web/frontend/js/features/outline/components/documentation-button.tsx index 13c3f844cf..514c429b29 100644 --- a/services/web/frontend/js/features/outline/components/documentation-button.tsx +++ b/services/web/frontend/js/features/outline/components/documentation-button.tsx @@ -33,36 +33,28 @@ function DocumentationButton() { function handleDocumentationLinkClick() { sendMB('file-tree-documentation-click') } + + if (!showDocumentationButton) return null + return ( -
- {showDocumentationButton ? ( -
-
- - -

{documentationButtonText}

-
- -
-
- ) : null} +
+ + +

{documentationButtonText}

+
+
) } diff --git a/services/web/frontend/stylesheets/app/editor/outline.less b/services/web/frontend/stylesheets/app/editor/outline.less index 60f7520e73..715772abd8 100644 --- a/services/web/frontend/stylesheets/app/editor/outline.less +++ b/services/web/frontend/stylesheets/app/editor/outline.less @@ -15,29 +15,32 @@ opacity: 0.5; } -.documentation-btn.outline-header-expand-collapse-btn { - justify-content: space-between; - padding-right: 0; -} - -.documentation-btn .btn { - padding-right: 0; -} - .documentation-link { display: flex; - margin-left: 0.5em; + flex: 1; } -.outline-header { +.documentation-btn-container { .toolbar-small-mixin; .toolbar-alt-mixin; display: flex; - flex-shrink: 0; - border-bottom: 1px solid @toolbar-border-color; - border-top: 1px solid @toolbar-border-color; + align-items: center; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + & *, + & :hover { + color: @white; + text-decoration: none; + } + &:hover { + background-color: @outline-header-hover-bg; + } } -.outline-footer { + +.documentation-close { + padding: 0; +} + +.outline-header { .toolbar-small-mixin; .toolbar-alt-mixin; display: flex;