Problem
When a CSS style is added and saved in the Stylify module, the style is applied
correctly and the visual change is immediately reflected on the page. However,
after refreshing the page, the saved style is no longer present and the visual
change is reverted.
Steps to Reproduce
- Install and enable the Stylify module.
- Open the Stylify editor.
-
Add the following CSS:
body { background: red; } - Save the style.
- Observe the page.
Actual result:
The page background changes to red immediately after saving.
- Refresh/reload the page.
- Open the Stylify editor again and check the saved styles.
Actual Result
The CSS style:
body { background: red; }
is removed after the page refresh, and the background color returns to its
previous state.
Expected Result
The saved CSS should persist after a page refresh and continue to be applied
to the page.
Impact
Users may believe their styles have been successfully saved because the
changes are visible immediately after saving. However, the styles are lost
after refreshing the page, resulting in data loss and unexpected
visual regressions.
Environment
- Drupal version: 10.6
- Stylify version: 1.0.0
- PHP version: 8.4
- Browser: google Chrome
- Theme: Olivero 10.6.13
- Multilingual configuration: Yes
Additional Information
The issue appears to be related to the persistence of styles after the save
operation. The style is successfully applied during the current session but
does not persist after a page reload.
This should be investigated to determine whether the style is not being
persisted correctly, is being removed during the subsequent page load, or is
not being retrieved correctly from storage.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot from 2026-08-26 14-55-25.png | 117.76 KB | yogesh045 | |
| Screenshot from 2026-08-26 14-49-14.png | 100.2 KB | yogesh045 |
Issue fork stylify-3619216
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
shardashukla commentedComment #3
yogesh045 commentedComment #5
shardashukla commentedFix saved CSS not persisting after page refresh
closes this #3619216
Comment #6
yogesh045 commentedReviewed and tested MR !4.
Testing performed:
Reproduced the original issue where saved CSS was applied immediately but disappeared after a page refresh.
Tested MR !4 with the following CSS:
body {
background: red;
}