Skip to main content

@pantheon-systems/wordpress-kit

Classes​

Type Aliases​

Color​

Ƭ Color: Object

Type declaration​

NameType
hexDefaultstring
namestring
tailwindDefaultstring
themeNamestring

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:220


ColorConfig​

Ƭ ColorConfig: Object

Type declaration​

NameType
cyanBluishGray?string
darkGray?string
foreground?string
lightGray?string
lightGreenCyan?string
luminousVividAmber?string
luminousVividOrange?string
paleCyanBlue?string
palePink?string
primary?string
secondary?string
stripes?string
tertiary?string
vividCyanBlue?string
vividGreenCyan?string
vividPurple?string
vividRed?string
white?string

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:4


FontSize​

Ƭ FontSize: Object

Type declaration​

NameType
defaultstring
namestring
tailwindstring

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:227


FontSizeConfig​

Ƭ FontSizeConfig: Object

Type declaration​

NameType
4xl?string
7xl?string
sm?string
xl?string

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:30


GradientColors​

Ƭ GradientColors: Object

Type declaration​

NameType
colorstring
positionstring

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:233


PaddingConfig​

Ƭ PaddingConfig: Object

Type declaration​

NameType
backgroundX?string
backgroundY?string

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:25


TailwindcssConfig​

Ƭ TailwindcssConfig: Config & WordPressMapConfig

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:238


ThemeType​

Ƭ ThemeType: <T>(path?: string, defaultValue?: T) => T

Type declaration​

▸ <T>(path?, defaultValue?): T

Type parameters​
NameType
TPartialThemeConfig | undefined
Parameters​
NameType
path?string
defaultValue?T
Returns​

T

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:246


WordPressMapConfig​

Ƭ WordPressMapConfig: Object

Type declaration​

NameType
theme?{ colors?: ColorConfig ; extend?: { colors?: ColorConfig ; fontSize?: FontSizeConfig ; padding?: PaddingConfig } ; fontSize?: FontSizeConfig ; padding?: PaddingConfig }
theme.colors?ColorConfig
theme.extend?{ colors?: ColorConfig ; fontSize?: FontSizeConfig ; padding?: PaddingConfig }
theme.extend.colors?ColorConfig
theme.extend.fontSize?FontSizeConfig
theme.extend.padding?PaddingConfig
theme.fontSize?FontSizeConfig
theme.padding?PaddingConfig

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/types.ts:37

Variables​

tailwindcssPlugin​

• Const tailwindcssPlugin: Object

Tailwindcss plugin that maps WordPress block editor styles to tailwindcss classes.

Type declaration​

NameType
config?Partial<Config>
handlerPluginCreator

Defined in​

packages/wordpress-kit/src/tailwindcssPlugin/index.ts:24

Functions​

gql​

▸ gql(chunks, ...variables): string

Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.

Parameters​

NameType
chunksTemplateStringsArray
...variablesany[]

Returns​

string

Example

import { gql } from 'graphql-request';

await request('https://foo.bar/graphql', gql`...`);

Remarks

Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named "gql". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.

Defined in​

node_modules/.pnpm/graphql-request@5.2.0_graphql@16.6.0/node_modules/graphql-request/build/esm/index.d.ts:142


setEdgeHeader​

▸ setEdgeHeader(«destructured»): void

Sets response headers for edge caching.

Parameters​

NameType
«destructured»Object
› cacheControl?string
› resServerResponse<IncomingMessage>

Returns​

void

Defined in​

packages/wordpress-kit/src/lib/setEdgeHeader.ts:10


setOutgoingHeaders​

▸ setOutgoingHeaders(«destructured»): void

Sets headers on outgoing responses which are necessary for managing cached content

Parameters​

NameType
«destructured»Object
› headersHeaders[]
› resServerResponse<IncomingMessage>

Returns​

void

Defined in​

packages/wordpress-kit/src/lib/setOutgoingHeaders.ts:23


setSurrogateKeyHeader​

▸ setSurrogateKeyHeader(keys, res): string | void

Adds an aggregated list of surrogate keys in the working response.

Parameters​

NameTypeDescription
keysnull | stringValue for surrogate-key header in API response.
resServerResponse<IncomingMessage>The active http.ServerResponse object.

Returns​

string | void

The current known unique set of surrogate keys.

Defined in​

packages/cms-kit/dist/lib/setSurrogateKeyHeader.d.ts:9