Skip to content

Make code in prose more salient? #1584

@Fil

Description

@Fil

In pangea, I've been using @mootari's stylesheet to display code in prose in a more visible way:

before after
before-dark after-dark
before-light after-light

I'd like this to be the default style in framework.

The CSS is somewhat heavy:

/* Makes code visible in prose */
a code {
  color: inherit;
}
span > code,
p > code,
li > code,
td > code,
th > code {
  color: var(--syntax-string);
  background-color: var(--theme-background-alt);
  padding: 3px 5px;
  border-radius: 4px;
}
a[href]:has(code):hover,
a[href]:has(code):focus {
  text-decoration: none;
}
a[href] > code {
  text-underline-offset: 2px;
  text-decoration: underline dotted 1.5px;
}
a[href]:hover > code,
a[href]:focus > code {
  text-decoration: underline solid 1.5px;
}
a[href]:visited > code {
  color: inherit;
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions