October 2017
Intermediate to advanced
370 pages
8h 57m
English
An interesting thing to note is that if any section of an accordion is expanded, AMP will apply the attribute expanded to that section. We can use this to improve the UX of the accordion. Now we can target an accordion section in CSS based on its expanded state, like this:
So, we could add rudimentary expanded/collapsed indicators with CSS pseudo elements like this:
amp-accordion section[expanded] h3::before { content: '+';}amp-accordion section:not([expanded]) h3::before { content: '-'; ...Read now
Unlock full access