0

I want to apply style(code below) only for lighting users.

<style>
        @media (min-width: 48em){
        .pbHeader .pbButton:last-child {
        padding-right: 0;
        text-align: center;
        }

    </style>

This is a css for pageblock buttons, and it is creating problems for me in classic. Is there any way by which I can only apply this css to lighting only?

3

You just need to check User.UIThemeDisplayed to get an idea if your user is in classic or Lightning

<apex:outputPanel rendered="{! $User.UIThemeDisplayed == 'Theme4d' }">
    <style>
        @media (min-width: 48em){
        .pbHeader .pbButton:last-child {
        padding-right: 0;
        text-align: center;
        }

    </style>
</apex:outputPanel>

Share Visualforce Pages Between Classic and Lightning Experience

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.