From b17280a9437db7807bcc04379d735137e8e8427c Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Tue, 2 Jul 2019 21:52:37 -0400 Subject: [PATCH] allow font color to skip over transparent color of embedded element used for textarea height content --- src/Internal/Model.elm | 28 +++++++++++++++++++++++----- src/Internal/Style.elm | 4 ---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/Internal/Model.elm b/src/Internal/Model.elm index b797030..8aef066 100644 --- a/src/Internal/Model.elm +++ b/src/Internal/Model.elm @@ -2681,11 +2681,29 @@ toStyleSheetString options stylesheet = ] Colored class prop color -> - renderStyle - maybePseudo - ("." ++ class) - [ Property prop (formatColor color) - ] + -- This is because the trick we're using to make a txtarea be height:content + -- stops the inheritance chain for font color. + -- So we need to pack our bags, hike up our socks and jump over the break. + if prop == "color" then + String.concat + [ renderStyle + maybePseudo + ("." ++ class) + [ Property prop (formatColor color) + ] + , renderStyle + maybePseudo + ("." ++ class ++ " ." ++ classes.inputMultilineParent ++ " ." ++ classes.inputMultiline) + [ Property prop (formatColor color) + ] + ] + + else + renderStyle + maybePseudo + ("." ++ class) + [ Property prop (formatColor color) + ] SpacingStyle cls x y -> let diff --git a/src/Internal/Style.elm b/src/Internal/Style.elm index 9d03ab0..0f86eb9 100644 --- a/src/Internal/Style.elm +++ b/src/Internal/Style.elm @@ -1531,11 +1531,7 @@ baseSheet = [ Prop "white-space" "pre-wrap" , Prop "height" "100%" , Prop "width" "100%" - - -- , Prop "color" "transparent" , Prop "background-color" "transparent" - - -- , Prop "caret-color" "black" ] , Descriptor (dot classes.inputMultilineParent) [ Prop "white-space" "pre-wrap"