Skip to Main Content
Feature Request FR-3595
Product Area User Interface
Status CLOSED

2 Voters

Inline CSS Property for Templates

greg Public
· Jan 26 2024

Idea Summary
Add a property/attribute to Templates for Inline CSS code

Use Case
When editing the Template Options we are providing CSS Class Names. Sometimes want our own custom classes and so we need a place to define the style rules for these classes. 

We could add a CSS file (somewhere) and then add a reference to the file in the Template. 
We could add the CSS to the Theme Style Inline CSS property. 
We could define it on a page in CSS Inline (every page we use this template) 
But to make the template more self contained and portable it would be nice to have it stored with the Template.
Having inline css rules would be good because then a developer can see what the Template Options will do.

We reviewed this idea carefully, and while it was interesting, we concluded that due to all the internal implications we need to take into account, it is unlikely to make its way into APEX.

Comments

Comments

  • fac586 OP 1.6 years ago

    Mysteriously this is already fully available on List templates (both File URLs and Inline) and partially (File URLs only) on Region and Report templates. Other template types do not expose these attributes.

    This has been the case since the introduction of the Universal Theme. I don't know the reasons for this inconsistent implementation, nor whether these settings [still?] work.

  • vincent morneau Admin OP 1.6 years ago

    Hi @greg ,

    Generally web apps should not encourage inline CSS. APEX has had inline CSS attributes for a long time, but there are no plans to introduce new ones. If anything changes, it's that those attributes could be deprecated (still working, but not recommended).

    If you are editing templates, you are probably the owner of your theme, and should consider moving the CSS code to your theme files. Hope that helps.

  • greg OP 1.6 years ago

    I'm curious to know more about why web apps should not encourage Inline CSS. Inline CSS here being just a property, metadata.

  • patrick wolf Admin OP 1.6 years ago

    Hi Greg,

    We do not encourage developers to use inline CSS because it will be rendered on every page view. If it's put into a static application or theme file, the browser caches the file and only loads it once. It also helps UI designers to have all customizations in a central place and not scattered on some pages or shared components. Long story short, it's performance and maintainability.

  • greg OP 1.6 years ago

    Thanks Patrick