From 40e2dcae0bccd5c4dd29815916f0032d20f14d9e Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 30 May 2025 11:07:42 +0200 Subject: [PATCH] Update lexical to support placeholders and style them up --- Gemfile.lock | 2 +- app/assets/stylesheets/actiontext-lexical.css | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d75f009a9..b0678ea5a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/basecamp/actiontext-lexical - revision: 375dce0f363411a60ad5a60db2f42f406396c919 + revision: 2b025527aacc85a6c2788176528d359826f304ac specs: actiontext-lexical (0.1.0) rails (>= 8.0.2) diff --git a/app/assets/stylesheets/actiontext-lexical.css b/app/assets/stylesheets/actiontext-lexical.css index c0ab455a5..303b3eec5 100644 --- a/app/assets/stylesheets/actiontext-lexical.css +++ b/app/assets/stylesheets/actiontext-lexical.css @@ -10,6 +10,16 @@ lexical-editor { } } } + + &.lexical-editor--empty { + .lexical-editor__content:not(:focus):before { + content: attr(placeholder); + color: currentColor; + opacity: 0.5; + pointer-events: none; + display: block; + } + } } .lexical-dialog-actions {