Skip to content

Commit 7d157be

Browse files
committed
Address PR feedback: mobile view, spacings
Address PR feedback: mobile view, spacings
1 parent 76d6537 commit 7d157be

File tree

10 files changed

+46
-142
lines changed

10 files changed

+46
-142
lines changed

src/components/Badge.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ $badge-border-radius: $border-radius - 1px !default;
4747
4848
@mixin badge-variation($color) {
4949
--badge-color: var(--color-badge-#{$color});
50-
--badge-dark-color: var(--color-badge-dark-#{$color})
50+
--badge-dark-color: var(--color-badge-dark-#{$color});
51+
--badge-text-color: var(--color-badge-text-#{$color});
5152
}
5253
5354
.badge {
@@ -61,7 +62,7 @@ $badge-border-radius: $border-radius - 1px !default;
6162
border-radius: $badge-border-radius;
6263
margin-left: 10px;
6364
border: 1px solid var(--badge-color);
64-
color: var(--badge-color);
65+
color: var(--badge-text-color);
6566
6667
.theme-dark & {
6768
--badge-color: var(--badge-dark-color);

src/components/DocumentationTopic.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<Abstract v-if="abstract" :content="abstract" />
1818
<Availability v-if="platforms" :platforms="platforms" />
1919
</DocumentationHero>
20-
<Summary v-if="!hideSummary" class="ribbon">
20+
<Summary v-if="!hideSummary">
2121
<TechnologyList v-if="modules" :technologies="modules" />
2222
<TechnologyList
2323
v-if="extendsTechnology"
@@ -32,7 +32,7 @@
3232
:swiftPath="swiftPath"
3333
/>
3434
</Summary>
35-
<div class="container" :class="{ 'full-width': hideSummary }">
35+
<div class="container">
3636
<Description :hasOverview="hasOverview">
3737
<RequirementMetadata
3838
v-if="isRequirement"
@@ -362,12 +362,6 @@ export default {
362362
}
363363
}
364364
365-
.ribbon {
366-
display: flex;
367-
flex-direction: row;
368-
justify-content: center;
369-
}
370-
371365
.container {
372366
@include breakpoint-dynamic-sidebar-content;
373367
outline-style: none;

src/components/DocumentationTopic/ContentTableSection.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
<template>
1212
<div class="contenttable-section">
13-
<div class="section-title" :span="span.title">
13+
<div class="section-title">
1414
<slot name="title">
1515
<h3 class="title">{{ title }}</h3>
1616
</slot>
1717
</div>
18-
<div class="section-content" :span="span.content">
18+
<div class="section-content">
1919
<slot name="abstract" />
2020
<slot name="discussion" />
2121
<slot />
@@ -32,22 +32,6 @@ export default {
3232
required: true,
3333
},
3434
},
35-
computed: {
36-
span() {
37-
return {
38-
title: {
39-
large: 3,
40-
medium: 3,
41-
small: 12,
42-
},
43-
content: {
44-
large: 9,
45-
medium: 9,
46-
small: 12,
47-
},
48-
};
49-
},
50-
},
5135
};
5236
</script>
5337

src/components/DocumentationTopic/RelationshipsList.vue

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,16 @@ export default {
128128
.relationships-list {
129129
list-style: none;
130130
131-
&.column {
132-
margin: 0;
133-
}
134-
135131
// The "inline" style displays items on a single line as a
136132
// comma-separated list with a maximum number of 3 items. This style should
137133
// not be used for a list that contains any items with availability
138134
// constraints information.
139135
&.inline {
140-
columns: 1;
141136
display: flex;
142137
flex-direction: row;
143138
flex-wrap: wrap;
144-
margin: 0;
139+
margin-top: 15px;
140+
margin-left: 0;
145141
146142
li:not(:last-child)::after {
147143
content: ",\00a0"
@@ -155,11 +151,6 @@ export default {
155151
&:after {
156152
margin-top: $change-coin-y-offset-reduced;
157153
}
158-
159-
// ensure that column layout stays a block content
160-
&.column {
161-
display: block;
162-
}
163154
}
164155
}
165156

src/components/DocumentationTopic/Summary.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ export default {
2727
.summary {
2828
color: var(--colors-secondary-label, var(--color-secondary-label));
2929
font-size: rem(16px);
30-
padding: 5px 0;
30+
padding: 11px 0;
3131
background-color: var(--color-fill-gray-quaternary);
3232
display: flex;
3333
align-items: center;
34+
justify-content: center;
3435
3536
@include breakpoint(medium) {
3637
padding-left: 2em;
3738
}
3839
3940
@include breakpoint(small) {
41+
flex-direction: column;
4042
padding-left: 0;
4143
margin-bottom: rem(40px);
42-
display: grid;
4344
grid-gap: rem(16px);
4445
grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
4546
}

src/components/DocumentationTopic/Summary/Availability.vue

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,36 @@
1818
class="platform"
1919
:change="!!changeFor(platform.name)"
2020
>
21-
<AvailabilityBadge>
21+
<Badge>
2222
<AvailabilityRange
2323
:deprecatedAt="platform.deprecatedAt"
2424
:introducedAt="platform.introducedAt"
2525
:platformName="platform.name"
2626
/>
27-
</AvailabilityBadge>
28-
<AvailabilityBadge v-if="platform.deprecatedAt" variant="deprecated" />
29-
<AvailabilityBadge v-else-if="platform.beta" variant="beta" />
27+
</Badge>
28+
<Badge v-if="platform.deprecatedAt" variant="deprecated" />
29+
<Badge v-else-if="platform.beta" variant="beta" />
3030
</Item>
3131
</List>
3232
</Section>
3333
</template>
3434

3535
<script>
36+
import Badge from 'docc-render/components/Badge.vue';
3637
import { getAPIChanges } from 'docc-render/mixins/apiChangesHelpers';
3738
import { ChangeTypes } from 'docc-render/constants/Changes';
3839
import AvailabilityRange from './AvailabilityRange.vue';
3940
import List from './List.vue';
4041
import ListItem from './ListItem.vue';
4142
import Section from './Section.vue';
42-
import AvailabilityBadge from './AvailabilityBadge.vue';
4343
4444
export default {
4545
name: 'Availability',
4646
mixins: [getAPIChanges],
4747
inject: ['identifier', 'store'],
4848
components: {
49+
Badge,
4950
AvailabilityRange,
50-
AvailabilityBadge,
5151
Item: ListItem,
5252
List,
5353
Section,
@@ -99,10 +99,14 @@ export default {
9999
.availability, .platform {
100100
box-sizing: inherit;
101101
display: inline-block;
102+
103+
@include breakpoint(small) {
104+
display: flex;
105+
justify-content: center;
106+
}
102107
}
103108
104109
.platform {
105-
padding-right: 2rem;
106110
box-sizing: border-box;
107111
108112
&::after {
@@ -112,17 +116,14 @@ export default {
112116
margin-top: 6px;
113117
}
114118
115-
&-badge {
116-
margin-left: rem(8px);
117-
}
119+
// &-badge {
120+
// margin-left: rem(8px);
121+
// }
118122
119123
@include change-highlight-horizontal-spacing();
120124
padding-left: 0;
121-
125+
padding-right: 0;
122126
margin-bottom: 0.25rem;
123-
&:last-child {
124-
margin-bottom: 0;
125-
}
126127
127128
@include change-highlight-vertical-spacing();
128129
@@ -141,4 +142,9 @@ export default {
141142
@include change-highlight-horizontal-text-alignment();
142143
}
143144
}
145+
146+
.badge {
147+
border-radius: 10.82px;
148+
margin-left: 0;
149+
}
144150
</style>

src/components/DocumentationTopic/Summary/AvailabilityBadge.vue

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/components/DocumentationTopic/Summary/LanguageSwitcher.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@ export default {
126126
font-size: 14px;
127127
margin-top: 0;
128128
display: flex;
129-
flex-direction: row;
130129
}
131130
132131
.language-option {
132+
&.swift {
133+
margin-right: 10px;
134+
}
135+
133136
@include breakpoint(small) {
134-
display: block;
135137
margin-bottom: 0.25rem;
136138
}
137139
@@ -143,7 +145,6 @@ export default {
143145
@include breakpoints-from(medium) {
144146
&.swift {
145147
border-right: 1px solid var(--color-fill-gray-tertiary);
146-
margin-right: 10px;
147148
}
148149
}
149150
}

src/components/DocumentationTopic/Summary/Section.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ export default { name: 'Section' };
1717
</script>
1818

1919
<style scoped lang="scss">
20+
@import 'docc-render/styles/_core.scss';
2021
.summary-section {
2122
margin-right: 1.5rem;
2223
2324
&:last-of-type {
2425
margin-right: 0;
2526
}
27+
28+
@include breakpoint(small) {
29+
margin-right: 0;
30+
}
2631
}
2732
</style>

0 commit comments

Comments
 (0)