Automattic / Automattic/jetpack

Forms: Only load the styles that are revelant for the specific form

Open
#41,521 3 comments 0 reactions 0 assignees View on GitHub
[Block] Form [Feature] Forms [Focus] Performance [Plugin] Jetpack [Pri] Normal Enhancement Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Quick summary

Currently when a user add the Jetpack form on to the page we also load grunion css file.
Which is about 20kb of css and contains the css for all the different "styles" of forms.

This should be reduced in such a way so that we only load the necessary styles.
A good first step would be to only include 1 style per css file.

### Steps to reproduce

Load a jetpack form on the frontend.
Notice the large css file.

### Site owner impact

Fewer than 20% of the total website/platform users

### Severity

Minor

### What other impact(s) does this issue have?

No revenue impact

### If a workaround is available, please outline it here.

_No response_

### Platform (Simple and/or Atomic)

Simple, Atomic, Self-hosted

Contributor guide

Open the contributing guide

Research direction

Start by locating the Jetpack form frontend code that loads the grunion CSS file. Reproduce the issue by loading a Jetpack form and inspecting the stylesheet, then trace how form styles are selected. Done means the frontend loads only the style needed for the specific form rather than the full collection of form styles.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.