mixin truncator(header = true, button = "Read more", title = "Some truncated content", boxed = false, headinglevel = 2, maxlines = null) .truncator(class!=attributes.class class= boxed ? "truncator--box" : "" style= maxlines != null ? "--max-lines: " + maxlines + ";" : "") if header if headinglevel == 1 h1.truncator__header= title else if headinglevel == 2 h2.truncator__header= title else if headinglevel == 3 h3.truncator__header= title else if headinglevel == 4 h4.truncator__header= title button(aria-expanded="false", hidden="hidden").truncator__expand if boxed span(title=button).button.button--small.button--icon.button--icon--hide-label= button else span.truncator__expand__visual-button= button .truncator__content block