|
| 1 | +--- |
| 2 | +const guides = [ |
| 3 | + { |
| 4 | + id: "layers", |
| 5 | + title: "Layers", |
| 6 | + summary: "Understand how layers structure your app", |
| 7 | + href: "/docs/reference/layers", |
| 8 | + }, |
| 9 | + { |
| 10 | + id: "from_custom_architecture", |
| 11 | + title: "From a custom architecture", |
| 12 | + summary: "Migrate your existing project to FSD incrementally", |
| 13 | + href: "/docs/guides/migration/from-custom", |
| 14 | + }, |
| 15 | + { |
| 16 | + id: "public_api", |
| 17 | + title: "Public API", |
| 18 | + summary: "Define clear boundaries between slices", |
| 19 | + href: "/docs/reference/public-api", |
| 20 | + }, |
| 21 | + { |
| 22 | + id: "cross_imports", |
| 23 | + title: "Cross-imports", |
| 24 | + summary: "Avoid the most common architectural violation", |
| 25 | + href: "/docs/guides/issues/cross-imports", |
| 26 | + }, |
| 27 | + { |
| 28 | + id: "excessive_entities", |
| 29 | + title: "Excessive Entities", |
| 30 | + summary: "Avoid over-splitting your domain into too many entities", |
| 31 | + href: "/docs/guides/issues/excessive-entities", |
| 32 | + }, |
| 33 | + { |
| 34 | + id: "faq", |
| 35 | + title: "FAQ", |
| 36 | + summary: "Find answers about adopting FSD in practice", |
| 37 | + href: "/docs/get-started/faq", |
| 38 | + }, |
| 39 | +]; |
| 40 | +
|
| 41 | +const iconFiles: Record<string, string> = { |
| 42 | + layers: "/img/landing/icons/icon_layers.svg", |
| 43 | + from_custom_architecture: "/img/landing/icons/icon_from_custom_architecture.svg", |
| 44 | + public_api: "/img/landing/icons/icon_public_api.svg", |
| 45 | + cross_imports: "/img/landing/icons/icon_cross_imports.svg", |
| 46 | + excessive_entities: "/img/landing/icons/icon_excessive_entities.svg", |
| 47 | + faq: "/img/landing/icons/icon_faq.svg", |
| 48 | +}; |
| 49 | +--- |
| 50 | + |
| 51 | +<section class="PopularGuides"> |
| 52 | + <div class="PopularGuides__inner"> |
| 53 | + <h2 class="PopularGuides__heading">Popular guides</h2> |
| 54 | + <div class="PopularGuides__grid"> |
| 55 | + { |
| 56 | + guides.map((guide) => ( |
| 57 | + <a class="PopularGuide" href={guide.href}> |
| 58 | + <img |
| 59 | + alt={`Icon: ${guide.title}`} |
| 60 | + class="PopularGuide__img" |
| 61 | + src={iconFiles[guide.id]} |
| 62 | + /> |
| 63 | + <div> |
| 64 | + <h3 class="PopularGuide__title">{guide.title}</h3> |
| 65 | + <p class="PopularGuide__summary">{guide.summary}</p> |
| 66 | + </div> |
| 67 | + </a> |
| 68 | + )) |
| 69 | + } |
| 70 | + </div> |
| 71 | + </div> |
| 72 | +</section> |
| 73 | + |
| 74 | +<style> |
| 75 | + .PopularGuides { |
| 76 | + margin-bottom: 4rem; |
| 77 | + margin-top: 4rem; |
| 78 | + } |
| 79 | + |
| 80 | + .PopularGuides__inner { |
| 81 | + max-width: 960px; |
| 82 | + box-sizing: border-box; |
| 83 | + margin: 0 auto; |
| 84 | + padding: 0 16px; |
| 85 | + } |
| 86 | + |
| 87 | + .PopularGuides__heading { |
| 88 | + font-size: 1.25rem; |
| 89 | + font-weight: 500; |
| 90 | + line-height: 1.3; |
| 91 | + color: var(--sl-color-white); |
| 92 | + margin-top: 1.75em; |
| 93 | + margin-bottom: 0.4em; |
| 94 | + } |
| 95 | + |
| 96 | + .PopularGuides__grid { |
| 97 | + display: grid; |
| 98 | + margin-left: -16px; |
| 99 | + margin-right: -16px; |
| 100 | + margin-top: 0.5rem; |
| 101 | + } |
| 102 | + |
| 103 | + @media (min-width: 768px) { |
| 104 | + .PopularGuides__grid { |
| 105 | + grid-template-columns: repeat(2, 1fr); |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + @media (min-width: 960px) { |
| 110 | + .PopularGuides__grid { |
| 111 | + grid-template-columns: repeat(3, 1fr); |
| 112 | + } |
| 113 | + } |
| 114 | + |
| 115 | + .PopularGuide { |
| 116 | + border-radius: 6px; |
| 117 | + display: flex; |
| 118 | + align-items: flex-start; |
| 119 | + gap: 16px; |
| 120 | + padding: 16px; |
| 121 | + text-decoration: none; |
| 122 | + transition: |
| 123 | + background-color 150ms, |
| 124 | + box-shadow 150ms; |
| 125 | + } |
| 126 | + |
| 127 | + .PopularGuide:hover { |
| 128 | + background-color: var(--hp-hover-bg); |
| 129 | + box-shadow: var(--hp-card-hover-shadow); |
| 130 | + text-decoration: none; |
| 131 | + } |
| 132 | + |
| 133 | + .PopularGuide__img { |
| 134 | + height: 48px; |
| 135 | + width: 48px; |
| 136 | + flex-shrink: 0; |
| 137 | + } |
| 138 | + |
| 139 | + .PopularGuide__title { |
| 140 | + font-size: 1rem; |
| 141 | + font-weight: 500; |
| 142 | + color: var(--sl-color-white); |
| 143 | + margin: 0 0 0.24rem 0; |
| 144 | + padding: 0; |
| 145 | + line-height: 1.3; |
| 146 | + } |
| 147 | + |
| 148 | + .PopularGuide__summary { |
| 149 | + color: var(--sl-color-gray-3); |
| 150 | + font-size: 0.875rem; |
| 151 | + line-height: 1.5; |
| 152 | + margin: 0; |
| 153 | + padding: 0; |
| 154 | + } |
| 155 | +</style> |
0 commit comments