Skip to content

Commit

Permalink
docs: polish highlight color
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jul 30, 2024
1 parent 1797e94 commit 75379e1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 47 deletions.
10 changes: 6 additions & 4 deletions docs/app/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const element = (
)
`,
{
highlightedLines: []
highlightedLines: [7]
}
],
[
Expand All @@ -64,7 +64,7 @@ function* foo(index) {
}
`,
{
highlightedLines: []
highlightedLines: [2]
}
],

Expand Down Expand Up @@ -126,7 +126,9 @@ function CodeFrame({ code, title = 'Untitled', index, highlightedLines = [] }) {
<div className='code-frame'>
<style>
{highlightedLines.map(line =>
`.code-label--${index} .code-frame .sh__line:nth-child(${line}) { background: rgba(0,0,0,.1); }`)
`.code-label--${index} .code-frame .sh__line:nth-child(${line}) {
background: #fcf5dc;
}`)
.join('\n') + '\n'
}
</style>
Expand Down Expand Up @@ -156,7 +158,7 @@ export default function Carousel() {

useEffect(() => {
const timer = setInterval(() => {
setSelected((selected + 1) % examples.length)
// setSelected((selected + 1) % examples.length)
} , 2500)
return () => clearInterval(timer)
}, [selected])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"codice": "^0.2.0",
"next": "14.2.3",
"next": "14.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sugar-high": "link:./",
Expand Down
80 changes: 38 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 75379e1

Please sign in to comment.