Article preview component

Solution retrospective
With this exercise, I learned about the javascript.
function share() {
let profile = document.querySelector('.profile');
let icons = document.querySelector('.icons');
let user = document.querySelector('.user');
let share = document.querySelector('.share');
if (icons.style.display === 'none') {
icons.style.display = 'flex';
if (window.matchMedia("(max-width: 600px)").matches) {
profile.style.display = 'none';
user.style.backgroundColor = '#48546a';
}
} else {
icons.style.display = 'none';
profile.style.display = 'flex';
user.style.backgroundColor = '#ffffff';
}
}
What challenges did you encounter, and how did you overcome them?
The ::after.
.icons::after {
content: "";
position: absolute;
bottom: -50%;
left: 52%;
transform: translateX(-50%);
border-width: 15px;
border-style: solid;
border-color: var(--color-Grayish-Blue) transparent transparent transparent;
}
What specific areas of your project would you like help with?
I'd like to know what's the best way to use ::after.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @MJspitta
You used ::after well! It's used to add things like tooltips, extra info and in this case show share links to socials. Very well done! You can check your share icon, when it is active the shade of the background is darker and the icon white.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord