Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
8 changes: 0 additions & 8 deletions .github/skills/feature-flags/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ function MyOverlay() {

## Real Codebase Examples

### Spinner animation sync (`packages/react/src/Spinner/Spinner.tsx`)

```tsx
const syncAnimationsEnabled = useFeatureFlag('primer_react_spinner_synchronize_animations')
const shouldSync = syncAnimationsEnabled && noMotionPreference
const mergedStyle = shouldSync ? {...style, animationDelay: `${syncDelay}ms`} : style
```

### CSS anchor positioning (`packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx`)

```tsx
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/FeatureFlags/DefaultFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export const DefaultFeatureFlags = FeatureFlagScope.create({
primer_react_select_panel_fullscreen_on_narrow: false,
primer_react_select_panel_order_selected_at_top: false,
primer_react_select_panel_remove_active_descendant: false,
primer_react_spinner_synchronize_animations: false,
primer_react_overlay_max_height_clamp_to_viewport: false,
})
5 changes: 1 addition & 4 deletions packages/react/src/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type {HTMLDataAttributes} from '../internal/internal-types'
import {useId} from '../hooks'
import classes from './Spinner.module.css'
import {useMedia} from '../hooks/useMedia'
import {useFeatureFlag} from '../FeatureFlags'

const ANIMATION_DURATION_MS = 1000

Expand Down Expand Up @@ -38,7 +37,6 @@ function Spinner({
delay = false,
...props
}: SpinnerProps) {
const syncAnimationsEnabled = useFeatureFlag('primer_react_spinner_synchronize_animations')
const noMotionPreference = useMedia('(prefers-reduced-motion: no-preference)', false)
const size = sizeMap[sizeKey]
const hasHiddenLabel = srText !== null && ariaLabel === undefined
Expand All @@ -64,8 +62,7 @@ function Spinner({
return null
}

const shouldSync = syncAnimationsEnabled && noMotionPreference
const mergedStyle = shouldSync ? {...style, animationDelay: `${syncDelay}ms`} : style
const mergedStyle = noMotionPreference ? {...style, animationDelay: `${syncDelay}ms`} : style
Comment thread
siddharthkp marked this conversation as resolved.

return (
/* inline-flex removes the extra line height */
Expand Down
Loading