Skip to content

Commit

Permalink
chore: update CTA button style
Browse files Browse the repository at this point in the history
  • Loading branch information
asthabh23 committed Jan 7, 2025
1 parent d0996c2 commit a88d81b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
26 changes: 13 additions & 13 deletions blocks/feed/feed.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@
box-shadow: 0 8px 16px rgba(0 0 0 / 40%);
}

.read-more {
display: inline-block;
margin-top: 10px;
padding: 10px 20px;
border-radius: 25px;
width: 150px;
background-color: var(--spectrum-blue);
color: white;
border: none;
cursor: pointer;
text-align: center;
.left-container {
display: flex;
flex-direction: column;
align-items: center;
}

.read-more:hover {
background-color: var(--dark-spectrum-blue);
.left-container .blog-item.latest:not(.read-more) {
display: flex;
flex-direction: column;
align-items: flex-start;
}

.left-container .read-more {
align-self: center;
display: inline-block;
}

.feed.recent .feed-item {
Expand Down
2 changes: 1 addition & 1 deletion blocks/feed/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function renderBlog(block) {
latestBlogItem.innerHTML = truncatedContent;
}

const readMoreButton = createTag('button', { class: 'read-more' }, 'Read More');
const readMoreButton = createTag('a', { href: latestBlog.path, class: 'read-more button primary large' }, 'Read More');
readMoreButton.addEventListener('click', () => {
window.location.href = latestBlog.path;
});
Expand Down
6 changes: 4 additions & 2 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ a.button > svg > use {

/* primary button: blue bg */
.redesign a.button:any-link,
main .form .button {
main .form .button,
.feed.blog .read-more {
cursor: pointer;
text-decoration: none;
padding: 5.5px 15px;
Expand Down Expand Up @@ -721,7 +722,8 @@ main .form .button {
}

.redesign a.button:any-link:hover,
main .form .button:hover {
main .form .button:hover,
.feed.blog .read-more:hover {
color: var(--spectrum-blue);
border-color: var(--spectrum-blue);
transform: translateZ(0);
Expand Down

0 comments on commit a88d81b

Please sign in to comment.