mirror of
https://github.com/documenso/documenso.git
synced 2026-07-24 17:04:12 +10:00
fix: handle hover styling for field containers
This commit is contained in:
@@ -5,6 +5,18 @@ export const FIELD_ROOT_CONTAINER_CLASS_NAME = `${FIELD_ROOT_CONTAINER_SHARED_CL
|
||||
|
||||
export const FIELD_ROOT_CONTAINER_PROBE_CLASS_NAME = `field--FieldRootContainerProbe ${FIELD_ROOT_CONTAINER_SHARED_CLASS_NAME}`;
|
||||
|
||||
/**
|
||||
* Class embedders target to style a field's hover state, e.g.
|
||||
* `.field--FieldRootContainerHover { background-color: ... }`.
|
||||
*
|
||||
* Canvas-rendered fields can't use the `:hover` pseudo-class (there's no real
|
||||
* DOM element to hover), so the hover probe applies this class permanently to
|
||||
* read the hovered cascade synchronously via `getComputedStyle`. Using a real
|
||||
* class instead of `:hover` keeps resolution deterministic — no stylesheet
|
||||
* parsing, pseudo-class synthesis, or source-order/specificity guesswork.
|
||||
*/
|
||||
export const FIELD_ROOT_CONTAINER_HOVER_CLASS_NAME = 'field--FieldRootContainerHover';
|
||||
|
||||
/**
|
||||
* Selector for the element the probe is appended into when reading computed
|
||||
* field styles. It must be an ancestor of where real fields render so the probe
|
||||
|
||||
Reference in New Issue
Block a user