4site-interactive-studios / engrid

The Unlicense
10 stars 4 forks source link

Improve VGS default styling over the CSS detection that EN does #294

Closed MichaelT372 closed 8 months ago

MichaelT372 commented 8 months ago

This PR aims to improve VGS styling defaults over what EN provides. EN will attempt to detect styles on a visible text field element and apply those as defaults to the VGS fields. It does this in 2 ways:

This can fail in numerous scenarios - the most obvious of which is when you don't have a visible text field on the page.

This PR instead will pass the ENgrid theme styles into the custom CSS properties and the VGS JavaScript, ensuring the field is always styled properly.

These are 2 caveats to this if you want to guarantee always perfect styling:

See this commit on AIUSA for an example of these 2: https://github.com/4site-interactive-studios/engrid-aiusa/commit/0ad3fb544c47205e7620cdaef94495abce5fca71