Skip to content

feat: Style presets#519

Open
Vibhuti410 wants to merge 19 commits intofrappe:developfrom
Vibhuti410:feature-style-book
Open

feat: Style presets#519
Vibhuti410 wants to merge 19 commits intofrappe:developfrom
Vibhuti410:feature-style-book

Conversation

@Vibhuti410
Copy link
Collaborator

Closes #106

Changes

  • Added Builder Style Preset DocType to manage presets from the desk with style_name, style_map (JSON) and sort_order fields
  • Added a Style select field in the Typography panel to apply the presets on text blocks
  • Fields that are controlled by the preset shows the value as a placeholder (inherited)
  • Also can manually override a field and when we clear that, the fields automatically takes back the preset value

New Files Added

  • stylePreset.ts — added this to fetch all style presets from the DocType
  • presetUtils.ts — added this to get the active preset's style map to avoid repetition and can be just imported wherever useful

Changes In Existing Files

  • TypographySection.ts — added the Style preset dropdown here
  • StylePropertyControl.vue — extended this to handle preset inheritence for all style fields
  • blockController.ts — added getPresetStyle and setPresetStyle methods here
  • block.ts — added presetStyle property to keep track of which preset is applied on a block

Demo:

Screen.Recording.2026-03-12.at.12.44.31.PM.mov

@surajshetty3416 surajshetty3416 changed the title Feature style book feat: Style presets Mar 12, 2026
@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.49%. Comparing base (b4c1f00) to head (f1efc6b).

Files with missing lines Patch % Lines
...ctype/builder_style_preset/builder_style_preset.py 0.00% 4 Missing ⚠️
...ilder/builder/doctype/builder_page/builder_page.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #519      +/-   ##
===========================================
- Coverage    63.56%   63.49%   -0.07%     
===========================================
  Files           27       29       +2     
  Lines         2791     2805      +14     
===========================================
+ Hits          1774     1781       +7     
- Misses        1017     1024       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@surajshetty3416 surajshetty3416 marked this pull request as draft March 15, 2026 08:47
@surajshetty3416 surajshetty3416 marked this pull request as ready for review March 16, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: style book

2 participants