Viet Tran a38d04c3d5
feat(search): overhaul relevance and curated design data
Overhaul BM25 relevance, reasoning and data-quality contracts; refresh UI styles and framework guidance; add resilient text, chip, badge and micro-interaction guidance; strengthen release, provenance and catalog refresh gates; update bilingual documentation.
2026-08-14 00:08:23 +07:00

16 KiB

1NoCategoryGuidelineDescriptionDoDon'tCode GoodCode BadSeverityDocs URLApplies ToStatusVerified At
21AnimationUse Tailwind animate utilitiesBuilt-in animations are optimized and respect reduced-motionUse animate-pulse animate-spin animate-pingCustom @keyframes for simple effectsanimate-pulse@keyframes pulse {...}Mediumhttps://tailwindcss.com/docs/animationhtml-tailwind 4.3active2026-08-13
32AnimationLimit bounce animationsContinuous bounce is distracting and can conflict with reduced-motion preferencesUse animate-bounce sparingly and add motion-reduce:animate-noneMultiple unbounded bounce animationsanimate-bounce motion-reduce:animate-none5+ elements with animate-bounceHighhttps://tailwindcss.com/docs/hover-focus-and-other-states#prefers-reduced-motionhtml-tailwind 4.3active2026-08-13
43AnimationTransition durationUse appropriate transition speeds for UI feedbackduration-150 to duration-300 for UIduration-1000 or longer for UI elementstransition-all duration-200transition-all duration-1000Mediumhttps://tailwindcss.com/docs/transition-durationhtml-tailwind 4.3active2026-08-13
54AnimationHover transitionsAdd smooth transitions on hover state changesAdd transition class with hover statesInstant hover changes without transitionhover:bg-gray-100 transition-colorshover:bg-gray-100 (no transition)Lowhtml-tailwind 4.3active2026-08-13
65Z-IndexUse Tailwind z-* scaleConsistent stacking context with predefined scalez-0 z-10 z-20 z-30 z-40 z-50Arbitrary z-index valuesz-50 for modalsz-[9999]Mediumhttps://tailwindcss.com/docs/z-indexhtml-tailwind 4.3active2026-08-13
76Z-IndexFixed elements z-indexFixed navigation and overlays need an intentional stacking orderUse documented z-* tokens for the application layerRely only on DOM order for stackingfixed top-0 z-50fixed top-0 (no z-index)Highhttps://tailwindcss.com/docs/z-indexhtml-tailwind 4.3active2026-08-13
87Z-IndexNegative z-index for backgroundsUse negative z-index for decorative backgroundsz-[-1] for background elementsPositive z-index for backgrounds-z-10 for decorativez-10 for backgroundLowhtml-tailwind 4.3active2026-08-13
98LayoutContainer max-widthLimit content width for readabilitymax-w-7xl mx-auto for main contentFull-width content on large screensmax-w-7xl mx-auto px-4w-full (no max-width)Mediumhttps://tailwindcss.com/docs/containerhtml-tailwind 4.3active2026-08-13
109LayoutResponsive paddingAdjust padding for different screen sizespx-4 md:px-6 lg:px-8Same padding all sizespx-4 sm:px-6 lg:px-8px-8 (same all sizes)Mediumhtml-tailwind 4.3active2026-08-13
1110LayoutGrid gapsUse consistent gap utilities for spacinggap-4 gap-6 gap-8Margins on individual itemsgrid gap-6grid with mb-4 on each itemMediumhttps://tailwindcss.com/docs/gaphtml-tailwind 4.3active2026-08-13
1211LayoutFlexbox alignmentUse flex utilities for alignmentitems-center justify-betweenMultiple nested wrappersflex items-center justify-betweenNested divs for alignmentLowhtml-tailwind 4.3active2026-08-13
1312ImagesAspect ratioMaintain consistent image aspect ratiosaspect-video aspect-squareNo aspect ratio on containersaspect-video rounded-lgNo aspect controlMediumhttps://tailwindcss.com/docs/aspect-ratiohtml-tailwind 4.3active2026-08-13
1413ImagesObject fitControl image scaling within containersobject-cover object-containStretched distorted imagesobject-cover w-full h-fullNo object-fitMediumhttps://tailwindcss.com/docs/object-fithtml-tailwind 4.3active2026-08-13
1514ImagesReserve image spaceGive image wrappers an aspect ratio or dimensions to avoid layout shiftsaspect-video or explicit dimensionsLet images determine layout after loadaspect-video overflow-hiddenImage without reserved spaceHighhttps://tailwindcss.com/docs/aspect-ratiohtml-tailwind 4.3active2026-08-13
1615ImagesResponsive image layoutAdjust image sizing and placement mobile-first with breakpoint variantsw-full md:w-1/2Use a fixed desktop width at every viewportw-full md:max-w-xlw-[900px]Highhttps://tailwindcss.com/docs/responsive-designhtml-tailwind 4.3active2026-08-13
1716TypographyProse pluginUse @tailwindcss/typography for rich textprose prose-lg for article contentCustom styles for markdownprose prose-lg max-w-noneCustom text stylingMediumhttps://tailwindcss.com/docs/typography-pluginhtml-tailwind 4.3active2026-08-13
1817TypographyLine heightUse appropriate line height for readabilityleading-relaxed for body textDefault tight line heightleading-relaxed (1.625)leading-none or leading-tightMediumhttps://tailwindcss.com/docs/line-heighthtml-tailwind 4.3active2026-08-13
1918TypographyFont size scaleUse consistent text size scaletext-sm text-base text-lg text-xlArbitrary font sizestext-lgtext-[17px]Lowhttps://tailwindcss.com/docs/font-sizehtml-tailwind 4.3active2026-08-13
2019TypographyText truncationHandle long text gracefullytruncate or line-clamp-*Overflow breaking layoutline-clamp-2No overflow handlingMediumhttps://tailwindcss.com/docs/text-overflowhtml-tailwind 4.3active2026-08-13
2120ColorsOpacity utilitiesUse color opacity utilitiesbg-black/50 text-white/80Separate opacity classbg-black/50bg-black opacity-50Lowhttps://tailwindcss.com/docs/background-colorhtml-tailwind 4.3active2026-08-13
2221ColorsDark modeSupport dark mode with dark: prefixdark:bg-gray-900 dark:text-whiteNo dark mode supportdark:bg-gray-900Only light themeMediumhttps://tailwindcss.com/docs/dark-modehtml-tailwind 4.3active2026-08-13
2322ColorsSemantic colorsDefine semantic design tokens with CSS-first @themeDeclare --color-primary and related tokens in @themeRepeat palette utilities in componentsbg-primarybg-blue-500 everywhereMediumhttps://tailwindcss.com/docs/themehtml-tailwind 4.3active2026-08-13
2423SpacingConsistent spacing scaleUse Tailwind spacing scale consistentlyp-4 m-6 gap-8Arbitrary pixel valuesp-4 (1rem)p-[15px]Lowhttps://tailwindcss.com/docs/customizing-spacinghtml-tailwind 4.3active2026-08-13
2524SpacingNegative marginsUse sparingly for overlapping effects-mt-4 for overlapping elementsNegative margins for layout fixing-mt-8 for card overlap-m-2 to fix spacing issuesMediumhtml-tailwind 4.3active2026-08-13
2625SpacingSpace betweenUse space-y-* for vertical listsspace-y-4 on flex/grid columnMargin on each childspace-y-4Each child has mb-4Lowhttps://tailwindcss.com/docs/spacehtml-tailwind 4.3active2026-08-13
2726FormsFocus statesAlways show focus indicatorsfocus:ring-2 focus:ring-blue-500Remove focus outlinefocus:ring-2 focus:ring-offset-2focus:outline-none (no replacement)Highhttps://tailwindcss.com/docs/hover-focus-and-other-states#focushtml-tailwind 4.3active2026-08-13
2827FormsInput sizingConsistent input dimensionsh-10 px-3 for inputsInconsistent input heightsh-10 w-full px-3Various heights per inputMediumhtml-tailwind 4.3active2026-08-13
2928FormsDisabled statesClear disabled stylingdisabled:opacity-50 disabled:cursor-not-allowedNo disabled indicationdisabled:opacity-50Same style as enabledMediumhtml-tailwind 4.3active2026-08-13
3029FormsPlaceholder stylingStyle placeholder text appropriatelyplaceholder:text-gray-400Dark placeholder textplaceholder:text-gray-400Default dark placeholderLowhtml-tailwind 4.3active2026-08-13
3130ResponsiveMobile-first approachStart with mobile styles and add breakpointsDefault mobile + md: lg: xl:Desktop-first approachtext-sm md:text-basetext-base max-md:text-smMediumhttps://tailwindcss.com/docs/responsive-designhtml-tailwind 4.3active2026-08-13
3231ResponsiveBreakpoint testingTest across breakpoint boundaries and representative viewport sizesTest below at and above configured breakpointsOnly test on development deviceTest mobile through 2xl boundariesSingle device testingHighhttps://tailwindcss.com/docs/responsive-designhtml-tailwind 4.3active2026-08-13
3332ResponsiveHidden/shown utilitiesControl visibility per breakpointhidden md:blockDifferent content per breakpointhidden md:flexSeparate mobile/desktop componentsLowhttps://tailwindcss.com/docs/displayhtml-tailwind 4.3active2026-08-13
3433ButtonsButton sizingConsistent button dimensionspx-4 py-2 or px-6 py-3Inconsistent button sizespx-4 py-2 text-smVarious padding per buttonMediumhtml-tailwind 4.3active2026-08-13
3534ButtonsTouch targetsMinimum 44px touch target on mobilemin-h-11 min-w-11 on mobileSmall buttons on mobilemin-h-11 min-w-11h-8 w-8 on mobileHighhttps://tailwindcss.com/docs/min-heighthtml-tailwind 4.3active2026-08-13
3635ButtonsLoading statesShow loading feedback and prevent duplicate activationDisable the action and expose busy stateLeave button clickable during loading<button disabled aria-busy='true'>Saving</button>Button without loading stateHighhttps://tailwindcss.com/docs/opacityhtml-tailwind 4.3active2026-08-13
3736ButtonsIcon buttonsAccessible icon-only buttonsaria-label on icon buttonsIcon button without label<button aria-label='Close'><XIcon/></button><button><XIcon/></button>Highhttps://tailwindcss.com/docs/screen-readershtml-tailwind 4.3active2026-08-13
3837CardsCard structureConsistent card stylingrounded-lg shadow-md p-6Inconsistent card stylesrounded-2xl shadow-lg p-6Mixed card stylingLowhtml-tailwind 4.3active2026-08-13
3938CardsCard hover statesInteractive cards should have hover feedbackhover:shadow-lg transition-shadowNo hover on clickable cardshover:shadow-xl transition-shadowStatic cards that are clickableMediumhtml-tailwind 4.3active2026-08-13
4039CardsCard spacingConsistent internal card spacingspace-y-4 for card contentInconsistent internal spacingspace-y-4 or p-6Mixed mb-2 mb-4 mb-6Lowhtml-tailwind 4.3active2026-08-13
4140AccessibilityScreen reader textProvide context for screen readerssr-only for hidden labelsMissing context for icons<span class='sr-only'>Close menu</span>No label for icon buttonHighhttps://tailwindcss.com/docs/screen-readershtml-tailwind 4.3active2026-08-13
4241AccessibilityFocus visibleShow focus only for keyboard usersfocus-visible:ring-2Focus on all interactionsfocus-visible:ring-2focus:ring-2 (shows on click too)Mediumhtml-tailwind 4.3active2026-08-13
4342AccessibilityReduced motionRespect user motion preferencesmotion-reduce:animate-noneIgnore motion preferencesmotion-reduce:transition-noneNo reduced motion supportHighhttps://tailwindcss.com/docs/hover-focus-and-other-states#prefers-reduced-motionhtml-tailwind 4.3active2026-08-13
4443PerformanceDeclare non-detected sourcesTailwind v4 detects source files automatically; use @source only for ignored or external paths@source '../node_modules/@acme/ui'Maintain a legacy content array for ordinary v4 sources@source '../node_modules/@acme/ui'content: ['./src/**/*.{js,ts,jsx,tsx}']Highhttps://tailwindcss.com/docs/detecting-classes-in-source-fileshtml-tailwind 4.3active2026-08-13
4544PerformanceJIT mode migrationTailwind v3 made JIT the default; remove obsolete mode configuration during migrationUse the v3 default compiler behaviorKeep mode:'jit' as a current v4 requirementTailwind v3 defaultsmode: 'jit'Mediumhttps://tailwindcss.com/blog/just-in-time-the-next-generation-of-tailwind-csshtml-tailwind legacy 3.xdeprecated2026-08-13
4645PerformanceAvoid @apply bloatUse @apply sparinglyDirect utilities in HTMLHeavy @apply usageclass='px-4 py-2 rounded'@apply px-4 py-2 rounded;Lowhttps://tailwindcss.com/docs/reusing-styleshtml-tailwind 4.3active2026-08-13
4746PluginsOfficial pluginsUse maintained plugins only for capabilities not built into core@tailwindcss/forms or @tailwindcss/typographyInstall legacy aspect-ratio or container-query plugins@tailwindcss/forms@tailwindcss/aspect-ratioMediumhttps://tailwindcss.com/docs/functions-and-directives#plugin-directivehtml-tailwind 4.3active2026-08-13
4847PluginsCustom utilitiesDefine reusable custom utilities with @utility@utility content-auto { content-visibility: auto; }Repeat complex arbitrary values@utility content-auto { content-visibility: auto; }[content-visibility:auto] everywhereMediumhttps://tailwindcss.com/docs/adding-custom-styles#adding-custom-utilitieshtml-tailwind 4.3active2026-08-13
4948LayoutContainer queriesUse built-in container queries and Tailwind 4.3 container-size queries for component responsiveness@container with @lg variants and @container-size when both dimensions matterInstall the retired container-query plugin@container @lg:grid-cols-2@tailwindcss/container-queriesMediumhttps://tailwindcss.com/blog/tailwindcss-v4-3html-tailwind 4.3active2026-08-13
5049InteractivityGroup and PeerStyle based on parent/sibling stategroup-hover peer-checkedJS for simple state interactionsgroup-hover:text-blue-500onMouseEnter={() => setHover(true)}Lowhttps://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-statehtml-tailwind 4.3active2026-08-13
5150CustomizationArbitrary ValuesUse [] for one-off valuesw-[350px] for specific needsCreating config for single usetop-[117px] (if strictly needed)style={{ top: '117px' }}Lowhttps://tailwindcss.com/docs/adding-custom-styles#using-arbitrary-valueshtml-tailwind 4.3active2026-08-13
5251ColorsTheme color variablesDeclare color namespaces in @theme so Tailwind generates semantic utilities@theme { --color-primary: oklch(...); }Use arbitrary CSS-variable utilities for registered tokensbg-primarybg-[var(--color-primary)]Mediumhttps://tailwindcss.com/docs/colors#customizing-your-colorshtml-tailwind 4.3active2026-08-13
5352ColorsUse bg-linear-to-* for gradientsTailwind v4 uses bg-linear-to-* syntax for gradientsbg-linear-to-r bg-linear-to-bbg-gradient-to-* (deprecated in v4)bg-linear-to-r from-blue-500 to-purple-500bg-gradient-to-r from-blue-500 to-purple-500Mediumhttps://tailwindcss.com/docs/background-imagehtml-tailwind 4.3active2026-08-13
5453LayoutUse shrink-0 shorthandShorter class name for flex-shrink-0shrink-0 shrinkflex-shrink-0 flex-shrinkshrink-0flex-shrink-0Lowhttps://tailwindcss.com/docs/flex-shrinkhtml-tailwind 4.3active2026-08-13
5554LayoutUse size-* for square dimensionsSingle utility for equal width and heightsize-4 size-8 size-12Separate h-* w-* for squaressize-6h-6 w-6Lowhttps://tailwindcss.com/docs/sizehtml-tailwind 4.3active2026-08-13
5655ImagesSVG explicit dimensionsAdd width and height attributes to reserve intrinsic SVG space before CSS loads<svg class='size-6' width='24' height='24'>SVG without intrinsic dimensions<svg class='size-6' width='24' height='24'><svg class='size-6'>Highhttps://tailwindcss.com/docs/widthhtml-tailwind 4.3active2026-08-13
5756PerformanceUse complete class tokensKeep utility class names statically detectable in sourceMap variants to complete tokens like colorMap[color]Construct partial tokens with interpolationconst colorMap = { red: 'bg-red-500', blue: 'bg-blue-500' }`bg-${color}-500`Highhttps://tailwindcss.com/docs/detecting-classes-in-source-files#dynamic-class-nameshtml-tailwind 4.3active2026-08-13
5857TypographyBalanced heading wrappingPolish short multi-line headings without fixing exact line breaksUse text-balance with a readable max-width and natural wrapping fallbackInsert hardcoded br tags or blanket nonbreaking spacesmax-w-xl text-balancewhitespace-nowrap with manual brMediumhttps://tailwindcss.com/docs/text-wraphtml-tailwind 4.3active2026-08-13
5958TypographyLong token resilienceAllow URLs identifiers and user content to break without widening flex layoutsUse wrap-anywhere on unpredictable text and min-w-0 on its flexible parentUse break-all globally or keep the flex child at its intrinsic minimumflex min-w-0 with wrap-anywhereflex with whitespace-nowrapHighhttps://tailwindcss.com/docs/overflow-wraphtml-tailwind 4.3active2026-08-13
6059LayoutCompact label layoutHandle chip and badge text overflow without breaking compact labels or hiding collection valuesUse flex flex-wrap gap-2 for collections; for one label use whitespace-nowrap bounded min-w-0 truncate and shrink-0 controlsClip a fixed-height row let labels wrap inside a pill or let dismiss icons shrinkflex flex-wrap gap-2; label min-w-0 whitespace-nowrap truncate; icon shrink-0flex h-8 overflow-hiddenHighhttps://tailwindcss.com/docs/flex-wraphtml-tailwind 4.3active2026-08-13