By Stephen Walker

In earlier posts, I have mentioned that I am transitioning post creation to the Gutenberg editor. If you haven’t tried the editor, please do, it is such a time saver and after five minutes, going back to the legacy editor will be painful – at least mentally.

One of the issues of this transition is how to get the Avada layout to allow the advantages of Gutenberg blocks to lay nicely with the textual content. I have tried a variety of fixes, but I think I finally have the correct combination.

Modern CSS to the rescue

The ability to use modern CSS is such a benefit these days. The often-maligned Internet Explorer is finally gone — or at least no longer supported. By using “:is()” in CSS we can now target specific portions of our content.

The solution (right now)

The latest solution uses the layout builder and applying the .article class to the column with the content element. Here is the CSS:

.article :is(h1,h2,h3,h4,h5,p,li){
  
  max-width:45rem;
  margin:1rem auto
}

.article p a , .article li a{
    text-decoration:underline!important;
  
}

.article p  a:hover, .article li a:hover{
    text-decoration:none!important;
    cursor:pointer;
  	outline: 3px solid transparent;
    color: #0F2131;
    background-color:rgba(252, 199, 94,.6);
    box-shadow: 0 -2px rgba(252, 199, 94,.6), 0 3px #0F2131;
}

This restrains the textual content to the industry’s ideal reading width (based on font size) but allows all the other elements and blocks to use the built-in layouts. Some research into floated images still needs to be done as these do not layout correctly.

Originally published on December 18, 2021

share the article

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

RELATED ARTICLES

  • CSS Variables in Avada

    The ability to use CSS variables directly in Avada settings can change your approach to design.

  • A Customized Read More Link

    Another in the series of micro-interactions. This time a read more link with what appears to be a shrinking underline.

  • System Font Weights

    This is just a quick post to give you the styles for the font weights that can be used with the system fonts.

  • Sharing Bar

    Emulating a popular fixed sharing bar with just Avada.