# Inline css issues

**URL:** <https://community.hubspot.com/t/inline-css-issues/115912>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [September 6, 2024, 12:17pm UTC](https://community.hubspot.com/t/inline-css-issues/115912 "2024-09-06T12:17:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![madsmoller](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@madsmoller](https://community.hubspot.com/u/madsmoller)\
**Post date:** [September 6, 2024, 12:17pm UTC](https://community.hubspot.com/t/inline-css-issues/115912/1 "2024-09-06T12:17:57Z")

</div>

Our sites have CSS inlined in the source code instead of generating a link to the css file. Our theme uses the following to add the css as a link.

`{{ require_css(get_asset_url('../css/main.css')) }}`

How do I change this behaviour?  
We would like all those css lines in a css file and cached by CDN.  
We have talked with the Theme Developer and they told us that its an issues in Hubspot for some of their clients.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [September 6, 2024, 12:39pm UTC](https://community.hubspot.com/t/inline-css-issues/115912/2 "2024-09-06T12:39:30Z")

</div>

Hi @madsmoller,

yes. This is currently happening for several people in several portals. @TomM2 noticed this a few days ago.  
Let’s include a few other devs from the community to this so they can check their portals @Jnix284, @Teun, @melindagreen.  
Two things I’ve tested the last couple of days:

```lia-code-sample
{{ require_css(get_asset_url('../css/main.css')) }}
{# or theme-override.css #}

```

are getting “inlined” with this method.

- Renaming it to something that is not main.css or theme-overrides.css(like combined-styles.css or customization.css) might help but I don’t suggest to do this unless you really know every file of your theme
- I’m loading my css files differently on [my website](https://graphispot.com) that’s why I was very surprised when @TomM2 mentioned that in a chat…

For anyone wondering how I’m loading my CSS:

```lia-code-sample
<link rel="preload" href="{{ (get_asset_url("../../css/main.css")) }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript>
 <link rel="stylesheet" href="{{ (get_asset_url("../../css/main.css")) }}">
</noscript>

<link rel="preload" href="{{ (get_asset_url("../../css/theme.css")) }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript>
 <link rel="stylesheet" href="{{ (get_asset_url("../../css/theme.css")) }}">
</noscript>

```

**My recommendation:**

Since this seems to be a bug/hickup that affects quite a lot of portals - HubSpot might be already working on a bug-fix. Therefore I wouldn’t change anything in the next couple of days/September.

best,

Anton

Edit:  
I’m also tagging a few dev-community moderators. Maybe they have some insights on this or can help forward this issue towards HubSpot.  
[@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074), @kennedyp

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [September 6, 2024, 3:45pm UTC](https://community.hubspot.com/t/inline-css-issues/115912/3 "2024-09-06T15:45:05Z")

</div>

@Anton for child themes, I change the require\_css to:

` {% set overwrite_child_css_path = '../../child.css' %}`

which forces the child.css to have the highest precedent in the theme and this is how it’s showing now:

![Jnix284_0-1725637292714.png](https://d2qpr2jzcazej7.cloudfront.net/optimized/3X/6/3/635020708e94ed486bf88f076b6ae69caf099e3f_2_690x37.png)

All of the theme CSS are either inline or like the above, with a few exceptions:

 ![Jnix284_1-1725637363186.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/a/abe2434481a47dfddc36d90624cdd9766c5e9b14.png)

I know without doubt that this was not the case previously and something has changed, this was flagged in Lighthouse and wasn’t an issue before:

 ![Jnix284_2-1725637496065.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/8/386be4814e275497346e7843fc23b923b7f80a38.png)

---

<div class="post-metadata">

**Author:** ![TomM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomm2/32/70887_2.png) [@TomM2](https://community.hubspot.com/u/TomM2)\
**Post date:** [September 6, 2024, 6:02pm UTC](https://community.hubspot.com/t/inline-css-issues/115912/4 "2024-09-06T18:02:07Z")

</div>

Thanks for the tag @Anton !

Just confirming from a theme developer who is experiencing this there have been no changes to the theme.

There are other people not using this theme who seem to be experiencing this.

I’ve seen this happen on marketing hub pro, content hub pro, content starter, and legacy marketing ent portals.

I’d say I first noticed it around last week (probablt Aug 26 at the earliest).

---

<div class="post-metadata">

**Author:** ![melindagreen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/melindagreen/32/73804_2.png) [@melindagreen](https://community.hubspot.com/u/melindagreen)\
**Post date:** [September 6, 2024, 2:03pm UTC](https://community.hubspot.com/t/inline-css-issues/115912/5 "2024-09-06T14:03:58Z")

</div>

I’m not seeing it happen, even when I recompile my CSS files to the “possibly offending” filenames, but I have a fairly custom setup in the first place -- almost all of my theme builds are 100% bespoke and I’ve ripped out all of the theme overrides and theme options because our agency builds each theme for a single brand.

So at least this indicates that the problem is not 100% based on file name…
