# Prevent custom blocks loading globally

**URL:** <https://forum.pinegrow.com/t/prevent-custom-blocks-loading-globally/7760>\
**Category:** Blocks\
**Created:** [February 20, 2023, 9:37am UTC](https://forum.pinegrow.com/t/prevent-custom-blocks-loading-globally/7760 "2023-02-20T09:37:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hannah](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/hannah/32/5047_2.png) [@Hannah](https://forum.pinegrow.com/u/Hannah)\
**Post date:** [February 20, 2023, 9:37am UTC](https://forum.pinegrow.com/t/prevent-custom-blocks-loading-globally/7760/1 "2023-02-20T09:37:18Z")

</div>

Hi all,  
Is there a way to prevent custom block stylesheets loading globally?

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [February 21, 2023, 12:35am UTC](https://forum.pinegrow.com/t/prevent-custom-blocks-loading-globally/7760/2 "2023-02-21T00:35:30Z")

</div>

@Hannah stylesheets included on Block action should be loaded only when the block is used.

It is also good idea to scope CSS rules to the block class:

.my-block {…}  
.my-block h1 {…}  
…

---

<div class="post-metadata">

**Author:** ![MichelyWeb](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/michelyweb/32/6652_2.png) [@MichelyWeb](https://forum.pinegrow.com/u/MichelyWeb)\
**Post date:** [November 11, 2023, 11:06am UTC](https://forum.pinegrow.com/t/prevent-custom-blocks-loading-globally/7760/3 "2023-11-11T11:06:47Z")

</div>

You can now in Pinegrow activate to load only assets for the used blocks. [See also here](https://forum.pinegrow.com/t/script-file-loads-in-editor-although-it-is-not-linked-via-editor-script/7202/16).

 ![CleanShot 2023-11-11 at 12.04.28@2x](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/4/4da7c8d531805a46204372a8ea47cd8a4e1e3a2f.png)
