cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to change the appearance of h2 in Magento 2 CSS - Where can I do this?

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Trying to change the appearance of h2 in Magento 2 CSS - Where can I do this?

Hello,

 

I'm pretty experienced with Magento 1 but finding Magento 2 a struggle. I want to change the appearance of <h2> text but I cannot find the .less file that will let me do this. Specifically, I want to a left and right margin to these on desktops (not mobile), can anyone help?

 

I have found the following code but that's pretty much the only reference to h2 that I can find anywhere and nothing I do to this will change the output on the screen. I've tried extending this in my theme and amending it directly.

(Also, I have run setup:upgrade and cleared the cash, etc).

 

I don't actually fully understand what '.lib-typography-headings()' does either.

 

lib/web/css/source/lib/_typography.less

 

 

.lib-typography-headings() {
    h1 {
        .lib-heading(h1);
    }

    h2 {
        .lib-heading(h2);
    }

    h3 {
        .lib-heading(h3);
    }

    h4 {
        .lib-heading(h4);
    }

    h5 {
        .lib-heading(h5);
    }

    h6 {
        .lib-heading(h6);
    }

    h1, h2, h3, h4, h5, h6 {
        small,
        .small {
            .lib-typography(
                @heading__small-size,
                @heading__small-color,
                @_line-height: @heading__small-line-height
            );
        }
    }
}