Unable to style an existing component

I’m creating a custom package/theme and I’m unable to get a component to be styled using the format:

const StyledLink = styled(Link)`
      text-decoration: none;
      font-size: 32px;

I have a link component that works fine when using it like <Link href='/'>This is a link</Link>

I am trying to add a StyledLink Component that will use Link, but just add css styles.

I can see that StyledLink appears in the source code in a stylesheet available to use, but it doesn’t get connected to the actual Link component in any way so the styles do not appear.

The styling appears in the source code like this:


But no element receives the class css-6m74xn-StyledLink so nothing is actually styled.

The StyledLink appears as if it was just a regular Link.

This is the entire file:

import React from "react";
import { connect, styled } from "frontity";
import Link from "./link";

const Header = () => {
	return (
		  <StyledLink href="/">
			This is a styled link
		  <Link href='/'>This is an unstyled link</Link>

export default connect(Header);

const Container = styled.div`
  width: 848px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 24px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-around;

const StyledLink = styled(Link)`
  text-decoration: none;
  font-size: 32px;

The Container component is styled exactly as you would expect. Only the StyledLink component isn’t.

Thanks for your help!

Hi @shehan11,

Can you please provide a repo or code-sandbox with your code? This is especially helpful to find solutions of technical issues with specific code

A post was split to a new topic: Issue adding styles to