Hi Simpson,
You are not missing anything in your setup, this is expected.
When a form uses the Orbital theme, Gravity Forms prints a small inline style block inside the form wrapper with the values from the form or block style settings. It prints them even if you did not change any setting. That block uses this selector:
#gform_wrapper_1[data-form-index="0"].gform-theme
It has an ID in it, so it is stronger than .gform-theme--framework.gform-theme--orbital. It also loads after your style.css. That is why your values only work with !important.
You have two options.
Option 1: Make your selector stronger
Add :not(#_) to your selector. It matches every form, but it counts like an ID, so your selector wins:
.gform-theme.gform-theme--framework.gform-theme--orbital:not(#_) {
--gf-color-primary: var(--primary-500);
--gf-ctrl-border-color: var(--neutral-300);
--gf-radius: var(--radius-md);
}
Option 2: Set the values with the gform_default_styles filter
This changes the values in the inline block itself, so you don’t need to fight the specificity. For example, in your theme functions.php:
add_filter( 'gform_default_styles', function( $styles ) {
$styles['inputPrimaryColor'] = '#1e40af';
$styles['inputBorderColor'] = '#d4d4d4';
$styles['inputBorderRadius'] = '6';
return $styles;
} );
This filter needs real values, so your Tailwind CSS variables will not work here. If you want to keep using your Tailwind variables, use option 1.
Docs:
One small thing: in your post, gform-theme–framework and var(–neutral-300) show a single long dash. This could just be the forum formatting. Please check that your file uses two normal hyphens (--).
Let me know if it still does not work.