Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions e2e/fixtures/theme-css/doc/prose/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Prose

## Paragraph

In Rspress, in addition to declaring [nav](https://rspress.rs/api/config/config-theme.html#nav) and [sidebar](https://rspress.rs/api/config/config-theme.html#sidebar) in the configuration file, you can also automatically generate the navigation bar and sidebar by declaring the `_nav.json` and `_meta.json` description files. We recommend the latter because it can make the configuration file more concise and clear, and it includes all the capabilities under `themeConfig`.

<p>some paragraph, some text here</p>

<p className="rp-not-doc">some paragraph, some text here</p>

## Blockquote

> blockquote text [rspress](https://rspress.rs)

<blockquote>
blockquote text{' '}
<a href="https://rspress.rs" target="_blank">
rspress
</a>
</blockquote>

<blockquote className="rp-not-doc">
blockquote text{' '}
<a href="https://rspress.rs" target="_blank">
rspress
</a>
</blockquote>

## List

- list item 1
- list item 2

<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>

<div className="rp-not-doc">
<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
</div>

## Table

| Header 1 | Header 2 |
| -------- | -------- |
| Data 1 | Data 2 |
| Data 1 | Data 2 |

<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody>
</table>

<div className="rp-not-doc">
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody>
</table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ export default function Playground(props: PlaygroundProps) {
'rspress-playground',
`rspress-playground-${direction}`,
`rspress-playground-reverse-${useReverseLayout ? 'y' : 'n'}`,
'rp-not-doc',
className,
].join(' ');
]
.filter(Boolean)
.join(' ');

return (
<div className={classNames} {...rest}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Container: React.FC<ContainerProps> = props => {

return (
<NoSSR>
<div className="rspress-preview">
<div className="rspress-preview rp-not-doc">
{isMobile === 'true' ? (
<div className="rspress-preview-wrapper rp-flex">
<div className="rspress-preview-code">{children?.[0]}</div>
Expand Down
22 changes: 7 additions & 15 deletions packages/plugin-twoslash/static/global-styles/twoslash.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
background-color: var(--twoslash-cursor-color);
}

.twoslash .twoslash-popup-inner > .rp-list-disc {
.twoslash .twoslash-popup-inner > ul {
width: 240px;
font-size: 0.8rem;
padding: 6px 8px;
Expand All @@ -256,36 +256,28 @@
gap: 4px;
}

.twoslash .twoslash-popup-inner > .rp-list-disc:hover {
.twoslash .twoslash-popup-inner > ul:hover {
user-select: auto;
}

.twoslash .twoslash-popup-inner > .rp-list-disc li {
.twoslash .twoslash-popup-inner > ul li {
overflow: hidden;
display: flex;
align-items: center;
gap: 0.25em;
line-height: 1em;
}

.twoslash
.twoslash-popup-inner
> .rp-list-disc
li
span.twoslash-completions-unmatched {
.twoslash .twoslash-popup-inner > ul li span.twoslash-completions-unmatched {
color: var(--twoslash-unmatched-color);
}

.twoslash .twoslash-popup-inner > .rp-list-disc .deprecated {
.twoslash .twoslash-popup-inner > ul .deprecated {
text-decoration: line-through;
opacity: 0.5;
}

.twoslash
.twoslash-popup-inner
> .rp-list-disc
li
span.twoslash-completions-matched {
.twoslash .twoslash-popup-inner > ul li span.twoslash-completions-matched {
color: var(--twoslash-matched-color);
}

Expand All @@ -299,7 +291,7 @@
}

/* Icons */
.twoslash .twoslash-popup-inner > .rp-list-disc .twoslash-completions-icon {
.twoslash .twoslash-popup-inner > ul .twoslash-completions-icon {
color: var(--twoslash-unmatched-color);
width: 1em;
flex: none;
Expand Down
13 changes: 0 additions & 13 deletions packages/theme-default/src/components/Link/index.module.scss

This file was deleted.

3 changes: 3 additions & 0 deletions packages/theme-default/src/components/Link/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.rp-link {
cursor: pointer;
}
10 changes: 5 additions & 5 deletions packages/theme-default/src/components/Link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import nprogress from 'nprogress';
import type React from 'react';
import type { ComponentProps } from 'react';
import { preloadLink } from '../Sidebar/utils';
import * as styles from './index.module.scss';
import { getHref, useNavigate } from './useNavigate';
import './index.scss';

export interface LinkProps extends ComponentProps<'a'> {
href?: string;
Expand Down Expand Up @@ -37,7 +37,7 @@ export function Link(props: LinkProps) {
href={href}
target="_blank"
rel="noopener noreferrer"
className={`${styles.link} ${className}`}
className={`rp-link ${className}`}
>
{children}
</a>
Expand All @@ -46,7 +46,7 @@ export function Link(props: LinkProps) {

if (linkType === 'hashOnly') {
return (
<a {...props} href={href} className={`${styles.link} ${className}`}>
<a {...props} href={href} className={`rp-link ${className}`}>
{children}
</a>
);
Expand All @@ -57,7 +57,7 @@ export function Link(props: LinkProps) {
<a
{...props}
href={href}
className={`${styles.link} ${className}`}
className={`rp-link ${className}`}
onMouseEnter={event => {
onMouseEnter?.(event);
preloadLink(removeBaseHref);
Expand Down Expand Up @@ -90,7 +90,7 @@ export function Link(props: LinkProps) {
<a
{...props}
href={withBaseHref}
className={`${styles.link} ${className}`}
className={`rp-link ${className}`}
onMouseEnter={event => {
onMouseEnter?.(event);
preloadLink(removeBaseHref);
Expand Down
11 changes: 1 addition & 10 deletions packages/theme-default/src/layout/DocLayout/docComponents/a.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { Link } from '@theme';
import type { ComponentProps } from 'react';
import * as styles from './index.module.scss';

export const A = (props: ComponentProps<'a'>) => {
const { href = '', className = '' } = props;

return (
<Link
{...props}
className={`${className} ${styles.link} ${styles.inlineLink}`}
href={href}
/>
);
return <Link {...props} />;
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import type { ComponentProps } from 'react';

export const Hr = (props: ComponentProps<'hr'>) => {
return (
<hr
{...props}
className="rp-my-12 rp-border-t rp-border-solid rp-border-divider-light"
/>
);
return <hr {...props} />;
};

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import type { ComponentProps } from 'react';

export const Ol = (props: ComponentProps<'ol'>) => {
return (
<ol {...props} className="rp-list-decimal rp-pl-5 rp-my-4 rp-leading-7" />
);
return <ol {...props} />;
};

export const Ul = (props: ComponentProps<'ul'>) => {
return (
<ul {...props} className="rp-list-disc rp-pl-5 rp-my-4 rp-leading-7" />
);
return <ul {...props} />;
};

export const Li = (props: ComponentProps<'li'>) => {
return <li {...props} className="[&:not(:first-child)]:rp-mt-2" />;
return <li {...props} />;
};
Loading
Loading