Closed rsalsbery closed 6 months ago
Loading it on page refresh would be acceptable, if live update is not feasible.
Successfully tested an approach to updating Custom CSS on-the-fly that should work going forward.
However, there are some inherent issues that prevent some Custom CSS from displaying as expected in the Live Editor versus the actual Screen. This does not mean it is not possible however! This means the Custom CSS will need to be written in a certain manner to achieve it and avoid side effects.
These are the recommendations:
BODY
selector, if possibleBODY
, use #screen-container-live, #screen-container-no-edit
#screen-container-no-edit
-- for the actual Screen#screen-container-live
-- for showing the effect within the Live Editor.These are the reasons:
BODY
tag. When in Live Editor mode, this BODY
tag represents the entire page, including all the DAKboard User Interface along with the Live Editor area. Thus, that is never the true desired target.For example, I would rewrite the original CSS noted in this issue to be:
@import url('https://fontlibrary.org/face/umberto');
#screen-container-live, #screen-container-no-edit
{
font-family: 'umberto';
}
Or, in the more preferable form, specifying only the named-block that we want to target:
@import url('https://fontlibrary.org/face/umberto');
#screen-container-live .block--MyNamedTextBlock,
#screen-container-no-edit .block--MyNamedTextBlock
{
font-family: 'umberto';
}
NOTE: These CSS rewrites will work with existing Production code, no code changes required for that part.
Merged in @ 85af459 and added to the queue for upcoming release to the live site.
When changing the font on a Screen using the Custom CSS method, the Font does update the Screen but it is not reflected when looking at it in the Screen editor. See below:
Screen Editor:
Screen in View:
This case is to see if we can have custom CSS reflected in the Editor.