From 7736a35f1db59c286c855925e21e43e21e73d711 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 1 Nov 2023 16:16:56 +0100 Subject: [PATCH] fix(editor): Fix outline visibility Signed-off-by: Jonas --- cypress/e2e/pages.spec.js | 20 ++++++++++++++++---- src/css/editor.scss | 13 +++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/pages.spec.js b/cypress/e2e/pages.spec.js index a8d0d08fd8..1bdc5e6a0a 100644 --- a/cypress/e2e/pages.spec.js +++ b/cypress/e2e/pages.spec.js @@ -283,7 +283,10 @@ describe('Page', function() { it('Allows to toggle persistent full-width view', function() { cy.openPage('Day 2') cy.get('#titleform').should('have.css', 'max-width', '100%') - cy.getReadOnlyEditor().invoke('outerWidth').should('eq', 670) + cy.getReadOnlyEditor() + .find('.editor__content') + .invoke('outerWidth') + .should('eq', 670) // Set full width mode cy.get('#titleform .action-item__menutoggle') @@ -291,12 +294,18 @@ describe('Page', function() { cy.contains('li.action', 'Full width') .click() cy.get('#titleform').should('have.css', 'max-width', 'none') - cy.getReadOnlyEditor().invoke('outerWidth').should('be.greaterThan', 700) + cy.getReadOnlyEditor() + .find('.editor__content') + .invoke('outerWidth') + .should('be.greaterThan', 700) // Reload to check persistence with browser storage cy.reload() cy.get('#titleform').should('have.css', 'max-width', 'none') - cy.getReadOnlyEditor().invoke('outerWidth').should('be.greaterThan', 700) + cy.getReadOnlyEditor() + .find('.editor__content') + .invoke('outerWidth') + .should('be.greaterThan', 700) // Unset full width mode cy.get('#titleform .action-item__menutoggle') @@ -304,7 +313,10 @@ describe('Page', function() { cy.contains('li.action', 'Full width') .click() cy.get('#titleform').should('have.css', 'max-width', '100%') - cy.getReadOnlyEditor().invoke('outerWidth').should('eq', 670) + cy.getReadOnlyEditor() + .find('.editor__content') + .invoke('outerWidth') + .should('eq', 670) }) }) diff --git a/src/css/editor.scss b/src/css/editor.scss index 1e7cd1c7ba..81812d9625 100644 --- a/src/css/editor.scss +++ b/src/css/editor.scss @@ -12,6 +12,11 @@ max-width: var(--text-editor-max-width); margin: auto; + &[data-collectives-el='editor'], + &[data-collectives-el='reader'] { + max-width: unset; + } + &.page-title { max-width: 100%; margin: 0 0 0 max(0px, calc(50% - (var(--text-editor-max-width) / 2))); @@ -24,3 +29,11 @@ margin: auto; } } + +/* TODO: remove once https://github.com/nextcloud/text/pull/4945 got released */ +.editor--outline { + border-radius: var(--border-radius-large); + box-shadow: 0 1px 10px var(--color-box-shadow); + background-color: var(--color-main-background); + z-index: 10021; +}