Skip to content

Commit d2b898f

Browse files
streamcode9claude
andauthored
Fix collapsible categories on index page for iPhone (#43)
- Increase button padding from 0 to 0.5rem with negative margin-left to improve touchable area on mobile - Add -webkit prefixes for smooth transforms and transitions on iOS Safari - Increase max-height from 1000px to 2000px to accommodate category content - Add :active state for better touch feedback - Prevent text selection on toggle buttons - Optimize opacity transition timing for smoother collapse animation Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4809204 commit d2b898f

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

assets/site.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,40 @@ section {
7575
color: var(--primary-color);
7676
font-size: 1rem;
7777
cursor: pointer;
78-
padding: 0;
78+
padding: 0.5rem;
7979
margin-right: 0.5rem;
80+
margin-left: -0.5rem;
8081
vertical-align: middle;
82+
-webkit-transition: -webkit-transform 0.2s ease, transform 0.2s ease;
8183
transition: transform 0.2s ease;
84+
-webkit-touch-callout: none;
85+
-webkit-user-select: none;
86+
user-select: none;
8287
}
8388

84-
.category-toggle:hover {
89+
.category-toggle:hover,
90+
.category-toggle:active {
8591
opacity: 0.7;
8692
}
8793

8894
.category-toggle[aria-expanded="false"] {
95+
-webkit-transform: rotate(-90deg);
8996
transform: rotate(-90deg);
9097
}
9198

9299
.category-content {
93100
overflow: hidden;
101+
-webkit-transition: -webkit-max-height 0.3s ease, max-height 0.3s ease, opacity 0.3s ease;
94102
transition: max-height 0.3s ease, opacity 0.3s ease;
95103
opacity: 1;
96-
max-height: 1000px;
104+
max-height: 2000px;
97105
}
98106

99107
.category-content.collapsed {
100108
max-height: 0;
101109
opacity: 0;
110+
-webkit-transition: -webkit-max-height 0.3s ease, max-height 0.3s ease, opacity 0.1s ease 0.1s;
111+
transition: max-height 0.3s ease, opacity 0.1s ease 0.1s;
102112
}
103113

104114
#posts-status {

0 commit comments

Comments
 (0)