Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9920b86
denoting main branch
LinKCoding Nov 21, 2025
eb724b0
docs: update props for more modular organization (#3217)
LinKCoding Nov 24, 2025
fe97fd6
Merge branch 'main' into kl-gmt-1451-logical-props
LinKCoding Jan 12, 2026
1abd01c
Merge branch 'main' into kl-gmt-1451-logical-props
LinKCoding Jan 29, 2026
567a6ae
feat: Updates to ThemeProvider, tokens, and transform to allow Logica…
LinKCoding Feb 6, 2026
efd5af8
Kl gmt 1510 logical border (#3264)
jakemhiller Feb 11, 2026
09e0652
feat(Icon): :sparkles: Add Live Learning Icon
zippyzow Feb 4, 2026
83ebf1b
chore(release): publish
codecademy-gh-api Feb 4, 2026
1683d7c
resolve merge conflict
LinKCoding Feb 11, 2026
bda4fe1
chore(release): publish
codecademy-gh-api Feb 9, 2026
f25a13e
docs: update background color for InfoTip zindex story
aresnik11 Feb 11, 2026
d127fde
chore(release): publish
codecademy-gh-api Feb 11, 2026
7efbb9a
feat: Updates to ThemeProvider, tokens, and transform to allow Logica…
LinKCoding Feb 6, 2026
28d8599
resolve merge conflict
LinKCoding Feb 11, 2026
a621ae9
Merge branch 'main' into kl-gmt-1451-logical-props--jh-revert
LinKCoding Feb 17, 2026
b43cbf1
feat: Layout related logical CSS props (#3267)
LinKCoding Mar 5, 2026
18a4d7f
feat: logical properties for inset and overflow (#3269)
LinKCoding Mar 5, 2026
8cc159e
merged main in
LinKCoding Mar 5, 2026
6663fb6
missed a merge conflict
LinKCoding Mar 5, 2026
bd97207
mis-read merge conflict, fixed duped themeprovider
LinKCoding Mar 5, 2026
5e0c46e
address Cass's feedback
LinKCoding Mar 10, 2026
2bd4f41
switch to opt-in, i.e. useLogicalProperties is false by default
LinKCoding Mar 10, 2026
6263f0e
add in some tests for popovercontainer
LinKCoding Mar 10, 2026
1581878
formatted
LinKCoding Mar 10, 2026
f09dace
Merge branch 'main' into kl-gmt-1451-logical-props--jh-revert
LinKCoding Mar 11, 2026
5996976
switch default in storybook to physical properties
LinKCoding Mar 12, 2026
e20f1ab
formatted
LinKCoding Mar 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions packages/gamut-styles/src/GamutProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@emotion/react';
import { MotionConfig } from 'framer-motion';
import { setNonce } from 'get-nonce';
import { useContext, useEffect, useRef } from 'react';
import { useContext, useEffect, useMemo, useRef } from 'react';
import * as React from 'react';

import { createEmotionCache } from './cache';
Expand All @@ -29,6 +29,10 @@ export interface GamutProviderProps {
* Pass a nonce to the cache to prevent CSP errors
*/
nonce?: string;
/**
* Whether to use logical properties for the theme
*/
useLogicalProperties?: boolean;
}

export const GamutContext = React.createContext<{
Expand Down Expand Up @@ -56,6 +60,7 @@ export const GamutProvider: React.FC<GamutProviderProps> = ({
useGlobals = true,
useCache = true,
nonce,
useLogicalProperties = false,
}) => {
const { hasGlobals, hasCache } = useContext(GamutContext);
const shouldCreateCache = useCache && !hasCache;
Expand All @@ -76,6 +81,7 @@ export const GamutProvider: React.FC<GamutProviderProps> = ({
const contextValue = {
hasGlobals: shouldInsertGlobals,
hasCache: shouldCreateCache,
useLogicalProperties,
nonce,
};

Expand All @@ -88,10 +94,23 @@ export const GamutProvider: React.FC<GamutProviderProps> = ({
</>
);

const content = (
<ThemeProvider theme={theme}>
{nonce ? <MotionConfig nonce={nonce}>{children}</MotionConfig> : children}
</ThemeProvider>
// Merge useLogicalProperties into theme so variance can access it via props.theme.
const themeWithLogicalProperties = useMemo(
() => ({ ...theme, useLogicalProperties }),
[theme, useLogicalProperties]
);

const content = useMemo(
() => (
<ThemeProvider theme={themeWithLogicalProperties}>
{nonce ? (
<MotionConfig nonce={nonce}>{children}</MotionConfig>
) : (
children
)}
</ThemeProvider>
),
[themeWithLogicalProperties, nonce, children]
);

if (activeCache.current) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe(GamutProvider, () => {
),
});

screen.getByText(JSON.stringify(theme));
screen.getByText(JSON.stringify({ ...theme, useLogicalProperties: false }));
});
it('it can have another GamutProvider as a child with creating multiple caches or globals', () => {
renderView({
Expand Down
Loading
Loading