Skip to main content

How to Apply Brizy Global Styling to ACF Fields?

Comments

2 comments

  • KC George

    Hi Daniel,

    Brizy does not have a feature to stylize the ACF WYSIWYG content using Brizy's global typography settings. However if ACF dynamic fields are being applied to blog posts and you are adding content using the Gutenberg editor and have applied content typographies in Gutenberg, you can map Gutenberg typographies to Brizy typographies using the Brizy 'Content' element.

    This would be the best way to apply Brizy typographies to your content. Would this be a feasible solution for your project? 

    0
  • Daniel Galle

    Hi KC,

    OK, and thank you for the response and potential solution. 

    I do not use the Gutenberg Blocks, I use solely the Brizy Builder and ACF for the entire site. Since it's only the Headers (H2 and H3 specifically) I need to style, I found a suitable solution by including "Additional CSS" in my them file (Blocksy theme). 

    I used the code below and it works perfectly :)

    Thanks,
    Daniel

    ----- Additional Theme CSS ---- Header styling and YouTube video aspect ratio control

    /* ACF WYSIWYG Editor H2 and H3 Override - Base styles for H2 and H3, applied at all sizes and overridden as necessary */
    h2, h3 {
        font-family: 'Montserrat', sans-serif; /* Setting Montserrat as the font for all H2 and H3 */
        color: #142850; /* Common font color for all headers */
        line-height: 1.3; /* Common line height for all headers */
    }

    /* Desktop Styles (992px and above) */
    @media (min-width: 992px) {
        h2 {
            font-size: 42px;
            font-weight: bold;
            letter-spacing: -1.5px;
        }
        h3 {
            font-size: 32px;
            font-weight: 600; /* Semi-bold is often represented as 600 weight */
            letter-spacing: -1.0px;
        }
    }

    /* Tablet Styles (768px to 991px) */
    @media (min-width: 768px) and (max-width: 991px) {
        h2 {
            font-size: 35px;
            font-weight: bold;
            letter-spacing: -0.5px;
        }
        h3 {
            font-size: 27px;
            font-weight: 600; /* Semi-bold is often represented as 600 weight */
            letter-spacing: 0.0px;
        }
    }

    /* Mobile Styles (0px to 767px) */
    @media (max-width: 767px) {
        h2 {
            font-size: 29px;
            font-weight: bold;
            letter-spacing: -0.5px;
        }
        h3 {
            font-size: 22px;
            font-weight: 600; /* Semi-bold is often represented as 600 weight */
            letter-spacing: 0.0px;
        }
    }

    /* ACF WYSIWYG Editor YouTube full width */
    iframe {
        aspect-ratio: 16 / 9; /* Sets the aspect ratio to 16:9 */
        width: 100%;    /* Make the iframe take the full width of its container */
        height: auto;   /* Optional: Adjust this depending on your needs */
        border: none;   /* Optional: Removes the border around iframes */
    }

    0

Please sign in to leave a comment.