Skip to main content
cngx-src documentation

provideTouchTargets

Functioncore/themingv0.1.0

projects/core/theming/touch-target.ts

Description#

Install the touch-target mode at app root and reflect it onto <html data-touch>. auto removes the attribute so the (any-pointer: coarse) media query derives the floor; on / off pin it. The reflector is an effect (not afterNextRender) so it re-runs on every runtime injectTouchTargets().set(...); the DOM write is wrapped in untracked() per the signal-architecture rules.

bootstrapApplication(AppComponent, {
  providers: [provideTouchTargets('on')],
});

Signature#

provideTouchTargets(initial: CngxTouchTargetValue)

Parameters#

@paraminitialCngxTouchTargetValue= 'auto'

Returns#

EnvironmentProviders