OperationCode/front-end

View on GitHub
components/Cards/ResourceCard/ResourceCard.module.css

Summary

Maintainability
Test Coverage
.ResourceCard {
  font-family: var(--secondaryFontFamily), sans-serif;
  margin: 1rem 0;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resourceName {
  display: inline;
  flex: 1;
}

.link {
  color: var(--secondary);
}

.link svg {
  top: 0;
  left: 0.5rem;
}

.descriptionText {
  overflow: hidden;
  position: relative;
}

.metadata {
  margin: 1rem 0;
}

.metadata p {
  margin: 0;
}

.metadataLabel {
  font-weight: bold;
}

.votingBlock {
  /**
   * It is always `display: flex`, but not defined
   * here because of responsive styles
   */
  align-items: center;
  font-size: 1rem;
  text-transform: none;
  gap: 0.75rem;
}

.desktopVotingBlock {
  display: flex;
  margin: -0.5rem -2rem 0 1rem;
}

.mobileVotingBlock {
  display: none;
  justify-content: space-between;
  border-top: 1px solid var(--gray);
  padding-top: 1.5rem;
}

@media screen and (--medium-viewport) {
  .desktopVotingBlock {
    display: none;
  }

  .mobileVotingBlock {
    display: flex;
    justify-content: flex-start;
  }
}

.votingBlockHeader {
  margin-right: 0.3125rem;
}

.voteInfo {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: nowrap;
  position: relative;
}

.voteCount {
  margin: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voteCount > span:last-child {
  height: 24px;
}

@media screen and (--medium-viewport) {
  .voteCount > span:last-child {
    height: 20px;
  }
}

.voteButton {
  background-color: inherit;
  border: 1px solid var(--secondary);
  border-radius: 3px;
  display: flex;
  font-size: 1rem;
  align-items: center;
  padding: 0.3125rem 0 0.25rem;
  text-decoration: none;
}

.voteButton,
.voteCount {
  opacity: 0.6;
}

.voteButton svg {
  height: 1rem;
  margin: 0 0.5rem;
}

.voteButton:focus-visible,
.voteButton:hover {
  background-color: var(--gray);
  cursor: pointer;
}

@media screen and (--medium-viewport) {
  .voteButton {
    padding: 0.75rem 0.75rem 0.5rem;
  }
}

.active {
  opacity: 1;
}

.icon {
  color: var(--secondary);
}

/* `.icon g` represents the negative space of Thumb icons */
.icon g {
  transition: 0.2s fill linear;
  fill: var(--white);
}

.icon.active g {
  transition: 0.2s fill linear;
  fill: var(--primary);
}

.voteButton:focus-visible .icon:not(.active) g,
.voteButton:hover .icon:not(.active) g {
  fill: var(--gray);
}