# Best Practice?: CSS/JS Code in Shortcode

**URL:** <https://discourse.gohugo.io/t/best-practice-css-js-code-in-shortcode/7497>\
**Category:** support\
**Created:** [July 18, 2017, 5:07pm UTC](https://discourse.gohugo.io/t/best-practice-css-js-code-in-shortcode/7497 "2017-07-18T17:07:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 18, 2017, 5:07pm UTC](https://discourse.gohugo.io/t/best-practice-css-js-code-in-shortcode/7497/1 "2017-07-18T17:07:59Z")

</div>

Should custom CSS and/or javascript which deals ONLY with whatever is in the desired shortcode only be shipping within the shortcode? Or should it be in the higher level layout templates? Does it matter?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [July 19, 2017, 12:28am UTC](https://discourse.gohugo.io/t/best-practice-css-js-code-in-shortcode/7497/2 "2017-07-19T00:28:54Z")

</div>

I would try to include it with the shortcode, if possible. I value a lean site, without loading resources unless they are required.
