Skip to content

Commit b4bb516

Browse files
improve 'Why Swift?' section on landing page (#252)
1 parent cb3e51c commit b4bb516

File tree

3 files changed

+55
-11
lines changed

3 files changed

+55
-11
lines changed

assets/stylesheets/_pages.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
@import "pages/landing";
12
@import "pages/getting-started";
2-
@import "pages/swift-evolution";
3+
@import "pages/swift-evolution";
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.why-swift-list {
2+
list-style: none;
3+
padding-left: 0;
4+
display: grid;
5+
gap: 1rem;
6+
7+
li {
8+
border: 1px solid var(--color-fill-tertiary);
9+
padding: 1rem;
10+
border-radius: 4px;
11+
display: flex;
12+
flex-direction: column;
13+
14+
h3 {
15+
line-height: 1.4;
16+
font-size: 1.4rem;
17+
padding-top: 0;
18+
}
19+
20+
p {
21+
flex-grow: 1;
22+
color: var(--color-secondary-label);
23+
margin-bottom: 0;
24+
}
25+
}
26+
27+
@media (min-width: 1000px) {
28+
grid-template-columns: repeat(3, 1fr);
29+
}
30+
}

index.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,30 @@ Swift is a general-purpose programming language built using a modern approach to
1616

1717
## Why Swift?
1818

19-
### Safe
19+
<ul class="why-swift-list">
20+
<li>
21+
<h3>Safe</h3>
22+
<p>
23+
Swift prioritizes safety and clarity, ensuring that code behaves in a safe manner while also promoting clear and concise programming practices.
24+
</p>
25+
</li>
26+
<li>
27+
<h3>Fast</h3>
28+
<p>
29+
Swift aims to replace C-based languages (C, C++, and Objective-C) and match their performance, while maintaining consistency and predictability.
30+
</p>
31+
</li>
32+
<li>
33+
<h3>Expressive</h3>
34+
<p>
35+
Swift builds upon decades of advancements in computer science, providing a modern syntax that is a joy to use.
36+
</p>
37+
</li>
38+
</ul>
2039

21-
The most obvious way to write code should also behave in a safe manner. Undefined behavior is the enemy of safety, and developer mistakes should be caught before software is in production. Opting for safety sometimes means Swift will feel strict, but we believe that clarity saves time in the long run.
22-
23-
### Fast
24-
25-
Swift is intended as a replacement for C-based languages (C, C++, and Objective-C). As such, Swift must be comparable to those languages in performance for most tasks. Performance must also be predictable and consistent, not just fast in short bursts that require clean-up later. There are lots of languages with novel features — being fast is rare.
26-
27-
### Expressive
28-
29-
Swift benefits from decades of advancement in computer science to offer syntax that is a joy to use, with modern features developers expect. But Swift is never done. We will monitor language advancements and embrace what works, continually evolving to make Swift even better.
40+
<div class="links links-list-nostyle" markdown="1">
41+
- [Learn more about Swift](/about)
42+
</div>
3043

3144
## Use cases
3245

0 commit comments

Comments
 (0)