Gatey-CSS-Variablen für den WordPress-Anmeldestatus
Gatey fügt benutzerdefinierte Eigenschaften in :root ein. Damit können Sie die Sichtbarkeit (flex / none) steuern oder Cognito-Daten über content ausgeben.
Initialisierungs-Flags
--gatey-initialized--gatey-not-initialized
Editor-Modus
Wenn eine Seite in Elementor oder Gutenberg geöffnet ist, setzt Gatey --gatey-in-editor auf flex, damit Elemente im Editor sichtbar bleiben, auch wenn sie auf der Live-Seite verborgen wären.
body.elementor-editor-active,
body.wp-admin,
body.block-editor-iframe__body {
--gatey-in-editor: flex;
}
Authentifizierung & MFA
--gatey-account-authenticated/--gatey-account-not-authenticated--gatey-account-mfa-enabled/--gatey-account-mfa-not-enabled
Gruppenmitgliedschaft
Für jede Cognito-Gruppe <g> setzt Gatey:
--gatey-account-group-<g>--gatey-account-group-not-<g>
Cognito-Attribute
--gatey-account-attribute-email--gatey-account-attribute-family_name- Benutzerdefinierte Attribute:
--gatey-account-attribute-custom-<attr>
Verwendungsbeispiele
/* Visible only to admins */
.admin-panel {
display: var(--gatey-account-group-admin);
}
/* Show element while editing, or when authenticated */
.show-in-editor-or-if-authenticated {
display: var(--gatey-in-editor, var(--gatey-account-authenticated, none));
}
