# Custom gradient CSS not working

**URL:** <https://community.shopify.com/t/custom-gradient-css-not-working/349168>\
**Category:** Store Design\
**Tags:** design, customizations, css, troubleshooting\
**Created:** [August 16, 2024, 7:36am UTC](https://community.shopify.com/t/custom-gradient-css-not-working/349168 "2024-08-16T07:36:47Z")\
**Posts on this page:** 5\
**Page:** 1

## AI-generated summary

Goal: Apply a site-wide linear-gradient background via custom CSS, but saving changes in the Online Store editor failed with the error “Online Store editor session can't be published.”

Key steps and fix:
- After requesting access details to inspect, a solution was provided to bypass the editor issue.
- Add the CSS directly in the theme’s base.css file (at the end), defining a .gradient class with the desired linear-gradient and an !important flag.

Result:
- The gradient background rendered correctly (confirmed by a screenshot). The original poster confirmed success and expressed thanks.

Notes:
- The solution relies on editing theme files rather than the Online Store editor’s custom CSS area.
- The exact CSS snippet (linear-gradient) is central to the fix; the .gradient class was used with !important to ensure it overrides existing styles.

Status: Resolved. No outstanding questions or disagreements. Images (screenshot) were used to verify the outcome.

<div class="post-metadata">

**Author:** ![zCiprian](https://avatars.discourse-cdn.com/v4/letter/z/9dc877/32.png) [@zCiprian](https://community.shopify.com/u/zCiprian)\
**Post date:** [August 16, 2024, 7:36am UTC](https://community.shopify.com/t/custom-gradient-css-not-working/349168/1 "2024-08-16T07:36:47Z")

</div>

Hi there,

So basically what I want to do is to integrate the following custom CSS code :

"

background-image: linear-gradient(to right top, #d4781a, #c86f2b, #b96837, #aa6140, #985c46, #8b5647, #7d5047, #6f4b46, #634342, #583c3d, #4c3538, #402e32);

" as a whole gradient background for my whole website. I put it into the custom CSS editor and when I try to save it it prompts me with the following " Online Store editor session can’t be published" .

Any ideas how can I solve this or any guidance on what I am doing wrong would be appreciated. Thank y

---

<div class="post-metadata">

**Author:** ![Abdosamer](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/abdosamer/32/243714_2.png) [@Abdosamer](https://community.shopify.com/u/Abdosamer)\
**Post date:** [August 16, 2024, 10:50am UTC](https://community.shopify.com/t/custom-gradient-css-not-working/349168/2 "2024-08-16T10:50:59Z")

</div>

Hi @zCiprian , can you share your store url?

---

<div class="post-metadata">

**Author:** ![zCiprian](https://avatars.discourse-cdn.com/v4/letter/z/9dc877/32.png) [@zCiprian](https://community.shopify.com/u/zCiprian)\
**Post date:** [August 16, 2024, 11:02am UTC](https://community.shopify.com/t/custom-gradient-css-not-working/349168/3 "2024-08-16T11:02:29Z")

</div>

Hi there:

[https://nestofnecessities.com/](https://nestofnecessities.com/)

password: powlye

---

<div class="post-metadata">

**Author:** ![Abdosamer](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/abdosamer/32/243714_2.png) [@Abdosamer](https://community.shopify.com/u/Abdosamer)\
**Post date:** [August 16, 2024, 11:10am UTC](https://community.shopify.com/t/custom-gradient-css-not-working/349168/4 "2024-08-16T11:10:01Z")

</div>

@zCiprian , go to your base.css file and add the following code at the end of it :

```css
.gradient {
    background: linear-gradient(to right top, #d4781a, #c86f2b, #b96837, #aa6140, #985c46, #8b5647, #7d5047, #6f4b46, #634342, #583c3d, #4c3538, #402e32) !important;
    
}

```

Result :

 ![Abdosamer_0-1723806588920.png](https://canada1.discourse-cdn.com/shopifyforum/original/3X/c/1/c161412f92c9ecd36da54e7af7a2d2188cd5d03c.jpeg)

---

<div class="post-metadata">

**Author:** ![zCiprian](https://avatars.discourse-cdn.com/v4/letter/z/9dc877/32.png) [@zCiprian](https://community.shopify.com/u/zCiprian)\
**Post date:** [August 16, 2024, 3:50pm UTC](https://community.shopify.com/t/custom-gradient-css-not-working/349168/5 "2024-08-16T15:50:30Z")

</div>

Thank you very much !
