Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styled-components syntax highlighting syntax with nested #254

Open
kud opened this issue Jun 8, 2020 · 0 comments
Open

Styled-components syntax highlighting syntax with nested #254

kud opened this issue Jun 8, 2020 · 0 comments

Comments

@kud
Copy link

kud commented Jun 8, 2020

image

const Timeline = styled.ul`
  list-style: none;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 6rem 0;
  font-family: var(--font-family-cond-semibold);
  letter-spacing: 0.1rem;

  ${({ finished }) =>
    finished &&
    css`
      ${Timeline.Item}:last-of-type {
        ${Timeline.Item.Bullet} {
          background: yellow;
        }
      }
    `}
`

Timeline.Item = styled.li`
  display: flex;
  position: relative;
  flex-grow: 1;
  text-align: center;

  &:before,
  &:after {
    content: "";
    flex-grow: 1;
    border-top: 2px solid white;
    margin-top: 20px;
  }

  &:first-of-type {
    text-align: left;
  }

  &:last-of-type {
    text-align: right;
  }

  &:first-of-type:before {
    display: none;
  }

  &:last-of-type:after {
    display: none;
  }

  ${({ isSelected }) =>
    isSelected &&
    css`
      ${Timeline.Item.Header.When} {
        margin-top: -0.3rem;
        font-size: 1.4rem;
      }

      ${Timeline.Item.Header.When} {
        font-size: 1.4rem;
      }
    `}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant