Commit cd1541fc authored by benjamin melançon's avatar benjamin melançon 🛠️
Browse files

Start section on removing divs

parent a5fb0fc6
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -15,3 +15,23 @@ Viewing the [Handlebars template used to generate the header section of the stat
```

The extra 'transparent-header' (which never shows up in any code but the SCSS/CSS as a searchable string like that) is because a fancy bit of [custom JavaScript included in the styleguide](https://gitlab.com/agaric/patternlibrary/blob/master/agaric/js/script.js) is constructing the class, which is used to determine the header background, depending on the viewers scroll position on the page.

## Removing Unwanted HTML Wrapping Elements

You may want to remove a lot of unnecessary `div`s when creating your own subtheme (almost all themes are ultimately a subtheme of [Drupal core's stable theme](https://www.drupal.org/docs/8/core/themes/stable-theme)), and you're especially likely to want to do this when implementing a styleguide on top of a subtheme.

A quick inspect or view source (with [Twig debugging turned on](https://www.drupal.org/docs/8/theming/twig/debugging-twig-templates))

[templates/block/block--system-branding-block.html.twig](https://cgit.drupalcode.org/bulma/tree/templates/block/block--system-branding-block.html.twig)

```
{% extends "block.html.twig" %}

{% block content %}
  // Stuff in here is whatever, take it or leave it, but not the divs we're after
{% endblock content %}
```

So we go look at