Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
holtzy committed Nov 12, 2024
1 parent 5ae3d11 commit dfb2147
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pages/course/scales/linear-scale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Exercise,
ExerciseDoubleSandbox,
} from '@/component/ExerciseDoubleSandbox';
import { scaleLinear } from 'd3';

const previousURL = '/course/scales/introduction';
const currentURL = '/course/scales/linear-scale';
Expand Down Expand Up @@ -102,7 +103,7 @@ const scale = scaleLinear()
.range([0, 500]);
console.log( scale(82) )
// 240
// 410
`}
/>
Expand Down
22 changes: 14 additions & 8 deletions pages/course/svg/tips-and-tricks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,26 @@ export default function Home() {
backgrounds; instead, you use <code>stroke</code> and <code>fill</code>{' '}
to control these aspects.
</p>

<p>
<br />
</p>

<blockquote className="bg-fuchsia-50 py-8">
For text elements, avoid using <code>stroke</code> to outline text, as
it can result in poor readability. Instead, focus on using{' '}
<code>fill</code> for color and <code>text-anchor</code> for alignment.
</p>
</blockquote>

<h2>5️⃣ CSS Specificity in SVG</h2>
<h2>5️⃣ Inheritance Rules</h2>
<p>
CSS specificity in SVG can be a bit more complex than in HTML. Styles
applied to SVG elements can come from inline styles, internal
stylesheets, or external stylesheets, and the rules of specificity still
apply. However, because SVG elements are often nested and grouped,
understanding which styles take precedence requires a good grasp of CSS
specificity rules.
In HTML, styling generally doesn’t inherit by default (e.g., a color
applied to a <code>div</code> doesn’t affect child elements unless they
inherit it explicitly). In SVG, many properties do inherit by default,
especially graphic-specific ones. For example, fill and stroke values
applied to an SVG container <code>g</code> (group) element will cascade
down to all children unless overridden. This makes grouping styles
common in SVG.
</p>

<h2>6️⃣ Text Wrapping</h2>
Expand Down

0 comments on commit dfb2147

Please sign in to comment.