12
votes
Accepted
Apex string with html tags in Visualforce
Yes you can:
Class Property
String str1="Dormammu! <div style='color:#313131;'> I have come to bargain!</div>";
VF Page
<apex:outputText value="{!str1}" escape="false"/>
When ...
11
votes
Accepted
SOQL Style Guidelnes - Large SELECT Clause
The convention I adopt when selecting many fields is to:
Put the SELECT clause on its own line
Indent each line in the actual fields by 1 tab/4 spaces
Generally put as many fields as possible on one ...
9
votes
Accepted
How can i use var() in css in LWC?
you can define custom properties either in components to make them local or load them from StaticResource, if they are not already present on the page.
Salesforce by default loads its' properties in :...
7
votes
Accepted
Object Icon without tab creation
I don't believe this is currently possible.
Consider voting for Assign a color and icon to all objects regardless of tab or not
I would like to assign colors and icons on an object basis, not just ...
6
votes
Accepted
Lightning:input type="file" change the "Upload Files" text
Try adding these lines to your Lightning Style:
/* remove the "or drop files" label from the right of the lightning:input type file */
.THIS .slds-file-selector__dropzone .slds-file-selector__text{
...
5
votes
Accepted
lightning:input style text-align:right;
As lightning:input gets converted into labels, divs and input elements in html while rendering in browser; updating to the below style selecting only the input element will make the text inside input ...
5
votes
Accepted
Visualforce <style> tag outputting as text in PDF
The renderer only accepts style formats in the head section of the page:
<apex:page StandardController="Project__c"
extensions="projectToPDFController"
renderAs="pdf"
...
4
votes
4 columns on a custom visual force inline page
Since we have a great comment thread going on, a wiki might be a good place to summarize:
You will have an easier time styling your page if you build your own <table> using standard html ...
Community wiki
4
votes
Accepted
Pad white space at the top of an outputText
A good tool to use when developing small Visualforce UIs is the HTML developer tools within your chosen browser which allows you to quickly and easily test out different css markup inline to help ...
4
votes
Lightning Design System - Large Buttons
Since there is no equivalent class modifiers like --large for slds-button,you have to add custom css to increase the button size in SLDS,like this:
<style>
.btn-lg{
height: 44px;
...
4
votes
Accepted
Align a command button using float:center style
There's no such CSS value for "float" of "center." If you want your commandButton to be in the middle of the area, you should do something like this:
<div style="text-align: center">
<...
4
votes
Accepted
ui:inputCheckbox not getting slds-styled when used as ltng:out in VF page
Below is what did I did to get the slds style on checkboxes.
<label class="slds-checkbox">
<ui:inputCheckbox value="{!v.isShown}" />
<span class="slds-checkbox--faux" />
...
4
votes
Accepted
Hide a commandLink onClick
First, in your CSS, changeMe should be .changeMe. However, that's not necessary, because you can just use slds-hide (assuming you use lightningStylesheets="true"), which does the work for you. Second, ...
4
votes
Flow builder - Style
If you are wanting to set all your text in all your "Display Text" components to bold, I'm not aware of a way to do this. But I've used a workaround for styling Display Text so I only have to update ...
4
votes
Accepted
Where to find the CSS styles behind a Salesforce CSS class?
The point of CSS styles in a framework is that you don't have to remember what specific things the styles do. Things like Bootstrap and SLDS provide a consistent user interface without knowing the ...
3
votes
Accepted
edit column style of page in lightning App builder
No, you can't modify the DOM outside of your own component. You'd want to write your own component that has both of the other components inside of it so you can control the layout, and place it in ...
3
votes
Accepted
Add style to body element of component
Access to document.body is apparently legal (see the Locker API Viewer under Secure Document), and it is indeed the only way you're going to get access to the main body. component.find() only works ...
3
votes
SOQL Style Guidelnes - Large SELECT Clause
While this remains open, I'll extend it to include how static SOQL fits with other code elements and offer this as an example:
for (Diagnosis__c d : [
select Id, MedicalCodeType__c, ...
3
votes
Accepted
'Correct' style for indenting list instantiations?
If the content is to be broken out over multiple lines, then completely separating the content from the container is another style:
List<String> listEg = new List<String>{
'a',
...
3
votes
Accepted
Focus box on lightning:input
The blue border is added by the lightning design system on the slds-input class like this:
.slds-input:focus, .slds-input:active {
outline: 0;
border-color: rgb(21, 137, 238); /* This is the ...
3
votes
Can we change Community Template Background dynamically?
I think your best bet is a thing called "Page Variations". You can create audiences and show them different variations of the page (including a different template)
This might still be hard to achieve,...
3
votes
Accepted
Lightning Styling - Component Not Rendering with Default Style
Unlike in the flexi pages(Lightning app builder pages) when you use components in an app, Your app needs to extend force:slds.
Using the Salesforce Lightning Design System in Apps
The Salesforce ...
3
votes
Accepted
custom CSS not applied to div
if the div is the first element in the component, the div is also .THIS, so .THIS .removedPositionFixed wont be found. Changing it to .THIS.removedPositionFixed (no space between .THIS and ....
2
votes
Accepted
Custom Component Not working as expected
Documentation is not entirely correct.
the border property should be as follows:
border: width style color
So it would be:
style="border: 1px solid {!borderColor}"
although this would work as ...
2
votes
Accepted
Red, Amber, Green (RAG Status) text color dependent on field number value in visualforce
Just use:
{!IF(cObject__c.FieldName__c < 50, 'red', IF(cObject__c.FieldName__c < 75, 'goldenrod', 'green'))}
2
votes
Accepted
Dynamically control table style (height, width etc.)
It's failing to compile because it doesn't like the standalone {!a}, but with a small change it should work:
public class Cntl_DynamicTableWidth {
String a{set; get;}
public ...
2
votes
How to modify @media css property in lightning styles
You need to enclose the elements that are affected by the media query in curly braces:
@media (min-width: 60em) {
.THIS .slds-modal__container{
margin: 0 auto;
width: 75%;
...
2
votes
Accepted
Not able to align fields in column in VF page
The actionRegion is causing the field to get screwed up. To get proper alignment, place each field as a direct child of pageBlockSection.
<apex:actionRegion >
<apex:pageBlockSection>
...
2
votes
Trying to make image in table clickable on Visualforce Page
You need to use the column facet for the column header and explicitly configure the body.
E.g.
<apex:dataTable value="{!List_of_images}" var="Rlist" styleClass="box" >
<apex:column ...
2
votes
Can we change Community Template Background dynamically?
The only way I know of to do something like this would be to use the Experience Id. Unfortunately to access the expid, you would likely need to set up Dynamic Branding URLs for login. You can learn ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
style × 98css × 35
visualforce × 30
lightning-aura-components × 24
lightning-web-components × 15
lightning × 12
apex × 9
slds × 9
html × 8
aura × 5
lightning-design-system × 4
stylesheets × 4
javascript × 3
community × 3
pdf × 3
table × 3
checkbox × 3
styleclass × 3
marketing-cloud × 2
visual-workflow × 2
lightning-community × 2
lightning-datatable × 2
dynamic × 2
commandbutton × 2
inputfield × 2