feat(guide): style guide layout and hide links in print view
- Add class names to Guide layout elements (, ). - Restrict guide max-width and add padding. - Update global styling to use outline. - Hide anchor tags and reset main margin in print media query.
This commit is contained in:
parent
c4a8f975c5
commit
03df525775
3 changed files with 23 additions and 8 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
main:has(.guide) {
|
||||||
|
padding-left: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guide {
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
.guide {
|
.guide {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useParams } from "react-router";
|
import "./Guide.css";
|
||||||
|
import { useParams, Link } from "react-router";
|
||||||
import { useGuides } from "../../../lib/contexts/guide.context";
|
import { useGuides } from "../../../lib/contexts/guide.context";
|
||||||
import useGuide from "../hooks/useGuide";
|
import useGuide from "../hooks/useGuide";
|
||||||
import { Link } from "react-router";
|
|
||||||
|
|
||||||
export default function Guide() {
|
export default function Guide() {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
@ -16,15 +16,17 @@ export default function Guide() {
|
||||||
<h1>{guide.title}</h1>
|
<h1>{guide.title}</h1>
|
||||||
<p>{guide.description}</p>
|
<p>{guide.description}</p>
|
||||||
|
|
||||||
<div>
|
<div className="guide__frames">
|
||||||
{guide.frames.map((frame, index) => (
|
{guide.frames.map((frame, index) => (
|
||||||
<div key={index}>
|
<div key={index} className="guide__frame">
|
||||||
<h2>{frame.title}</h2>
|
<h2>{frame.title}</h2>
|
||||||
<img src={URL.createObjectURL(frame.file)} alt={frame.title} />
|
<img src={URL.createObjectURL(frame.file)} alt={frame.title} />
|
||||||
|
|
||||||
<ol>
|
<ol className="steps">
|
||||||
{frame.steps.map((step, stepIndex) => (
|
{frame.steps.map((step, stepIndex) => (
|
||||||
<li key={stepIndex}>{step.text}</li>
|
<li key={stepIndex} className="guide__step">
|
||||||
|
{step.text}
|
||||||
|
</li>
|
||||||
))}
|
))}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -86,13 +86,18 @@ textarea {
|
||||||
}
|
}
|
||||||
|
|
||||||
:focus-visible {
|
:focus-visible {
|
||||||
border-color: #ff7700 !important;
|
outline: 2px solid #ff7700;
|
||||||
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
header,
|
header,
|
||||||
footer,
|
footer,
|
||||||
button {
|
button,
|
||||||
|
a {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
main {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue