# Soil-clean-up body class may conflict with existing css class

**URL:** https://discourse.roots.io/t/soil-clean-up-body-class-may-conflict-with-existing-css-class/7679
**Category:** plugins
**Created:** 2016-09-19T13:55:11Z
**Posts:** 3

## Post 1 by @sylvain261 — 2016-09-19T13:55:11Z

Using the page slug as an automatic classname for the body can create conflicts with existing css.  
I would prefer the following naming convention : page-$slug

=\>  
if (!in\_array(‘page-’.basename(get\_permalink()), $classes)) {  
$classes[] = ‘page-’.basename(get\_permalink());  
}

---

## Post 2 by @ben — 2016-09-20T00:40:21Z

I am open to changing this. At this point we’ve been doing this for several years, and Sage’s JavaScript routing is also dependent on this existing naming convention.

---

## Post 3 by @stuartcusackie — 2019-02-01T11:28:20Z

It took a few minutes to figure out why the layout was broken on one of my client’s pages, but it’s down to this same problem.

The website has a page called ‘Media’ and thus a class called ‘media’ is added to the body, which conflicts with Bootstrap’s ‘media’ class and applies a flex layout to the whole body.

So I removed the `$classes[] = basename(get_permalink());` block entirely. I don’t think I would ever use that for CSS targetting.
