work on formatting

pull/2206/head
Richard Harris 7 years ago
parent 3511d0fa34
commit 21f9b81604

@ -20,14 +20,14 @@ All three sections — script, styles and markup — are optional.
<!-- markup (zero or more items) goes here --> <!-- markup (zero or more items) goes here -->
``` ```
### Script ### &lt;script&gt;
---
A `<script>` block contains JavaScript that runs when a component instance is created. Variables declared (or imported) at the top level are 'visible' from the component's markup. There are four additional rules: A `<script>` block contains JavaScript that runs when a component instance is created. Variables declared (or imported) at the top level are 'visible' from the component's markup. There are four additional rules:
#### 1. `export` creates a component prop #### 1. `export` creates a component prop
---
Svelte uses the `export` keyword to mark a variable declaration as a *property* or *prop*, which means it becomes accessible to consumers of the component: Svelte uses the `export` keyword to mark a variable declaration as a *property* or *prop*, which means it becomes accessible to consumers of the component:
```html ```html
@ -72,7 +72,7 @@ Update expressions (`count += 1`) and property assignments (`obj.x = y`) have th
--- ---
Any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with the `$:` label. Reactive statements run immediately before the component updates, whenever the values that they depend on have changed: Any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with the `$:` label. Reactive statements run immediately before the component updates, whenever the values that they depend on have changed.
```html ```html
<script> <script>
@ -91,7 +91,7 @@ Any top-level statement (i.e. not inside a block or a function) can be made reac
--- ---
If a statement consists entirely of an assignment to an undeclared variable, Svelte will inject a `let` declaration on your behalf: If a statement consists entirely of an assignment to an undeclared variable, Svelte will inject a `let` declaration on your behalf.
```html ```html
<script> <script>
@ -122,11 +122,15 @@ Local variables (that do not represent store values) must *not* have a `$` prefi
``` ```
#### Module context ### &lt;script context="module"&gt;
---
A `<script>` tag with a `context="module"` attribute runs once when the module first evaluates, rather than for each component instance. Values declared in this block are accessible from a regular `<script>` (and the component markup) but not vice versa. A `<script>` tag with a `context="module"` attribute runs once when the module first evaluates, rather than for each component instance. Values declared in this block are accessible from a regular `<script>` (and the component markup) but not vice versa.
You can `export` bindings from this block, and they will become exports of the compiled module: You can `export` bindings from this block, and they will become exports of the compiled module.
You cannot `export default`, since the default export is the component itself.
```html ```html
<script context="module"> <script context="module">
@ -145,12 +149,14 @@ You can `export` bindings from this block, and they will become exports of the c
</script> </script>
``` ```
You cannot `export default`, since the default export is the component itself.
### &lt;style&gt;
---
### Styles CSS inside a `<style>` block will be scoped to that component.
CSS inside a `<style>` block will be scoped to that component: This works by adding a class to affected elements, which is based on a hash of the component styles (e.g. `svelte-123xyz`).
```html ```html
<style> <style>
@ -161,9 +167,9 @@ CSS inside a `<style>` block will be scoped to that component:
</style> </style>
``` ```
This works by adding a class to affected elements, which is based on a hash of the component styles (e.g. `svelte-123xyz`). ---
To apply styles to a selector globally, use the `:global(...)` modifier: To apply styles to a selector globally, use the `:global(...)` modifier.
```html ```html
<style> <style>
@ -179,389 +185,4 @@ To apply styles to a selector globally, use the `:global(...)` modifier:
color: goldenrod; color: goldenrod;
} }
</style> </style>
``` ```
### Markup
#### Tags
A lowercase tag, like `<div>`, denotes a regular HTML element. A capitalised tag, such as `<Widget>`, indicates a *component*.
#### Attributes
By default, attributes work exactly like their HTML counterparts:
```html
<div class="foo">
<button disabled>can't touch this</button>
</div>
```
As in HTML, values may be unquoted:
```html
<input type=checkbox>
```
Attribute values can contain JavaScript expressions:
```html
<a href="page/{p}">page {p}</a>
```
Or they can *be* JavaScript expressions:
```html
<button disabled={!clickable}>...</button>
```
An expression might include characters that would cause syntax highlighting to fail in regular HTML, in which case quoting the value is permitted. The quotes do not affect how the value is parsed:
```html
<button disabled="{number !== 42}">...</button>
```
It's often necessary to pass a property to an element or component directly, so a shorthand is permitted — these two are equivalent:
```html
<button disabled={disabled}>...</button>
<button {disabled}>...</button>
```
*Spread attributes* allow many attributes or properties to be passed to an element or component at once:
```html
<Widget {...things}/>
```
An element or component can have multiple spread attributes, interspersed with regular ones.
#### Text expressions
Text can also contain JavaScript expressions:
```html
<h1>Hello {name}!</h1>
<p>{a} + {b} = {a + b}.</p>
```
#### HTML expressions
In a text expression, characters like `<` and `>` are escaped. An expression can inject HTML with `{@html expression}`:
```html
<div class="blog-post">
<h1>{post.title}</h1>
{@html post.content}
</div>
```
> Svelte does not sanitize expressions before injecting HTML. If the data comes from an untrusted source, you must sanitize it, or you are exposing your users to an XSS vulnerability.
#### If blocks
Content that is conditionally rendered can be wrapped in an `{#if condition}` block, where `condition` is any valid JavaScript expression:
```html
{#if answer === 42}
<p>what was the question?</p>
{/if}
```
Additional conditions can be added with `{:else if condition}`, optionally ending in an `{:else}` clause:
```html
{#if porridge.temperature > 100}
<p>too hot!</p>
{:else if 80 > porridge.temperature}
<p>too cold!</p>
{:else}
<p>just right!</p>
{/if}
```
#### Each blocks
Iterating over lists of values can be done with an `{#each list as item}` block, where `list` is any valid JavaScript expression and `item` is a valid JavaScript identifier, or a destructuring pattern.
```html
<h1>Shopping list</h1>
<ul>
{#each items as item}
<li>{item.name} x {item.qty}</li>
{/each}
</ul>
```
An `#each` block can also specify an *index*, equivalent to the second argument in an `array.map(...)` callback:
```html
{#each items as item, i}
<li>{i + 1}: {item.name} x {item.qty}</li>
{/each}
```
It can also specify a *key expression* in parentheses — again, any valid JavaScript expression — which is used for list diffing when items are added or removed from the middle of the list:
```html
{#each items as item, i (item.id)}
<li>{i + 1}: {item.name} x {item.qty}</li>
{/each}
```
You can freely use destructuring patterns in `each` blocks:
```html
{#each items as { id, name, qty }, i (id)}
<li>{i + 1}: {name} x {qty}</li>
{/each}
```
An `#each` block can also have an `{:else}` clause, which is rendered if the list is empty:
```html
{#each todos as todo}
<p>{todo.text}</p>
{:else}
<p>No tasks today!</p>
{/each}
```
#### Await blocks
Await blocks allow you to branch on the three possible states of a Promise — pending, fulfilled or rejected:
```html
{#await promise}
<!-- promise is pending -->
<p>waiting for the promise to resolve...</p>
{:then value}
<!-- promise was fulfilled -->
<p>The value is {value}</p>
{:catch error}
<!-- promise was rejected -->
<p>Something went wrong: {error.message}</p>
{/await}
```
The `catch` block can be omitted if no error is possible, and the initial block can be omitted if you don't care about the pending state:
```html
{#await promise then value}
<p>The value is {value}</p>
{/await}
```
#### DOM events
Use the `on:` directive to listen to DOM events:
```html
<script>
let count = 0;
function handleClick(event) {
count += 1;
}
</script>
<button on:click={handleClick}>
count: {count}
</button>
```
You can add *modifiers* to DOM events with the `|` character:
```html
<form on:submit|preventDefault={handleSubmit}>
<!-- the `submit` event's default is prevented,
so the page won't reload -->
</form>
```
The following modifiers are available:
* `preventDefault` — calls `event.preventDefault()` before running the handler
* `stopPropagation` — calls `event.stopPropagation()`, preventing the event reaching the next element
* `passive` — improves scrolling performance on touch/wheel events (Svelte will add it automatically where it's safe to do so)
* `capture` — fires the handler during the *capture* phase instead of the *bubbling* phase
* `once` — remove the handler after the first time it runs
Modifiers can be chained together, e.g. `on:click|once|capture={...}`.
If the `on:` directive is used without a value, the component will *forward* the event, meaning that a consumer of the component can listen for it.
#### Component events
Components can emit events using [createEventDispatcher](#docs/createEventDispatcher), or by forwarding DOM events. Listening for component events looks the same as listening for DOM events:
```html
<SomeComponent on:whatever={handler}/>
```
#### Element bindings
Data ordinarily flows from parent to child. The `bind:` directive allows data to flow the other way, from child to parent. Most bindings are specific to particular elements:
```html
<!-- inputs and textareas -->
<input bind:value={name}>
<textarea bind:value={text}></textarea>
<!-- numeric inputs (the value is coerced to a number) -->
<input type="number" bind:value={num}>
<input type="range" bind:value={num}>
<!-- checkbox inputs -->
<input type="checkbox" bind:checked={yes}>
<!-- grouped inputs (single value) -->
<input type="radio" bind:group={tortilla} value="Plain">
<input type="radio" bind:group={tortilla} value="Whole wheat">
<input type="radio" bind:group={tortilla} value="Spinach">
<!-- grouped inputs (multiple value) -->
<input type="checkbox" bind:group={fillings} value="Rice">
<input type="checkbox" bind:group={fillings} value="Beans">
<input type="checkbox" bind:group={fillings} value="Cheese">
<input type="checkbox" bind:group={fillings} value="Guac (extra)">
<!-- dropdowns -->
<select bind:value={selected}>
<!-- option values do not have to be
strings, or even primitive values -->
<option value={a}>a</option>
<option value={b}>b</option>
<option value={c}>c</option>
</select>
```
If the name matches the value, you can use a shorthand. These are equivalent:
```html
<input bind:value={value}>
<input bind:value>
```
Media elements (`<audio>` and `<video>`) have their own set of bindings — four *readonly* ones...
* `duration` (readonly) — the total duration of the video, in seconds
* `buffered` (readonly) — an array of `{start, end}` objects
* `seekable` (readonly) — ditto
* `played` (readonly) — ditto
...and three *two-way* bindings:
* `currentTime` — the current point in the video, in seconds
* `paused` — this one should be self-explanatory
* `volume` — a value between 0 and 1
Block-level elements have readonly `clientWidth`, `clientHeight`, `offsetWidth` and `offsetHeight` bindings, measured using a technique similar to [this one](http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/).
To get a reference to a DOM node, use `bind:this`:
```html
<script>
import { onMount } from 'svelte';
let canvasElement;
onMount(() => {
const ctx = canvasElement.getContext('2d');
drawStuff(ctx);
});
</script>
<canvas bind:this={canvasElement}></canvas>
```
#### Component bindings
You can bind to component props using the same mechanism:
```html
<Keypad bind:value={pin}/>
```
Components also support `bind:this`, allowing you to interact with component instances programmatically.
#### Classes
A `class:` directive provides a shorter way of toggling a class on an element. These are equivalent:
```html
<div class="{active ? 'active' : ''}">...</div>
<div class:active={active}>...</div>
<!-- equivalent shorthand, for when name and value match -->
<div class:active>...</div>
```
#### Actions
Actions are functions that are called when an element is created. They must return an object with a `destroy` method that is called after the element is unmounted:
```html
<script>
function foo(node) {
// the node has been mounted in the DOM
return {
destroy() {
// the node has been removed from the DOM
}
};
}
</script>
<div use:foo></div>
```
An action can have arguments. If the returned value has an `update` method, it will be called whenever those arguments change, immediately after Svelte has applied updates to the markup:
```html
<script>
export let bar;
function foo(node, bar) {
// the node has been mounted in the DOM
return {
update(bar) {
// the value of `bar` has changed
},
destroy() {
// the node has been removed from the DOM
}
};
}
</script>
<div use:foo={bar}></div>
```
> Don't worry about the fact that we're redeclaring the `foo` function for every component instance — Svelte will hoist any functions that don't depend on local state out of the component definition.
#### TODO
* transitions
* animations
* slots
* special elements

@ -0,0 +1,592 @@
---
title: Template syntax
---
### Tags
---
A lowercase tag, like `<div>`, denotes a regular HTML element. A capitalised tag, such as `<Widget>`, indicates a *component*.
```html
<script>
import Widget from './Widget.svelte';
</script>
<div>
<Widget/>
</div>
```
### Attributes
---
By default, attributes work exactly like their HTML counterparts.
```html
<div class="foo">
<button disabled>can't touch this</button>
</div>
```
---
As in HTML, values may be unquoted.
```html
<input type=checkbox>
```
---
Attribute values can contain JavaScript expressions.
```html
<a href="page/{p}">page {p}</a>
```
---
Or they can *be* JavaScript expressions.
```html
<button disabled={!clickable}>...</button>
```
---
An expression might include characters that would cause syntax highlighting to fail in regular HTML, in which case quoting the value is permitted. The quotes do not affect how the value is parsed:
```html
<button disabled="{number !== 42}">...</button>
```
---
When the attribute name and value match (`name={name}`), they can be replaced with `{name}`.
```html
<!-- These are equivalent -->
<button disabled={disabled}>...</button>
<button {disabled}>...</button>
```
---
*Spread attributes* allow many attributes or properties to be passed to an element or component at once.
An element or component can have multiple spread attributes, interspersed with regular ones.
```html
<Widget {...things}/>
```
### Text expressions
* `{expression}`
---
Text can also contain JavaScript expressions:
```html
<h1>Hello {name}!</h1>
<p>{a} + {b} = {a + b}.</p>
```
### HTML expressions
* `{@html expression}`
---
In a text expression, characters like `<` and `>` are escaped. With HTML expressions, they're not.
> Svelte does not sanitize expressions before injecting HTML. If the data comes from an untrusted source, you must sanitize it, or you are exposing your users to an XSS vulnerability.
```html
<div class="blog-post">
<h1>{post.title}</h1>
{@html post.content}
</div>
```
### If blocks
* `{#if expression}...{/if}`
* `{#if expression}...{:else if expression}...{/if}`
* `{#if expression}...{:else}...{/if}`
---
Content that is conditionally rendered can be wrapped in an if block.
```html
{#if answer === 42}
<p>what was the question?</p>
{/if}
```
---
Additional conditions can be added with `{:else if expression}`, optionally ending in an `{:else}` clause.
```html
{#if porridge.temperature > 100}
<p>too hot!</p>
{:else if 80 > porridge.temperature}
<p>too cold!</p>
{:else}
<p>just right!</p>
{/if}
```
### Each blocks
* `{#each expression as name}...{/each}`
* `{#each expression as name, index}...{/each}`
* `{#each expression as name, index (key)}...{/each}`
* `{#each expression as name}...{:else}...{/each}`
---
Iterating over lists of values can be done with an each block.
```html
<h1>Shopping list</h1>
<ul>
{#each items as item}
<li>{item.name} x {item.qty}</li>
{/each}
</ul>
```
---
An each block can also specify an *index*, equivalent to the second argument in an `array.map(...)` callback:
```html
{#each items as item, i}
<li>{i + 1}: {item.name} x {item.qty}</li>
{/each}
```
---
If a *key* expression is provided, Svelte will diff the list when data changes, rather than adding or removing items at the end.
```html
{#each items as item, i (item.id)}
<li>{i + 1}: {item.name} x {item.qty}</li>
{/each}
```
---
You can freely use destructuring patterns in each blocks.
```html
{#each items as { id, name, qty }, i (id)}
<li>{i + 1}: {name} x {qty}</li>
{/each}
```
---
An each block can also have an `{:else}` clause, which is rendered if the list is empty.
```html
{#each todos as todo}
<p>{todo.text}</p>
{:else}
<p>No tasks today!</p>
{/each}
```
### Await blocks
* `{#await expression}...{:then name}...{:catch name}...{/await}`
* `{#await expression}...{:then name}...{/await}`
* `{#await expression then name}...{/await}`
---
Await blocks allow you to branch on the three possible states of a Promise — pending, fulfilled or rejected.
```html
{#await promise}
<!-- promise is pending -->
<p>waiting for the promise to resolve...</p>
{:then value}
<!-- promise was fulfilled -->
<p>The value is {value}</p>
{:catch error}
<!-- promise was rejected -->
<p>Something went wrong: {error.message}</p>
{/await}
```
---
The `catch` block can be omitted if no error is possible, and the initial block can be omitted if you don't care about the pending state.
```html
{#await promise then value}
<p>The value is {value}</p>
{/await}
```
### DOM events
* `on:eventname={handler}`
* `on:eventname|modifiers={handler}`
---
Use the `on:` directive to listen to DOM events.
```html
<script>
let count = 0;
function handleClick(event) {
count += 1;
}
</script>
<button on:click={handleClick}>
count: {count}
</button>
```
---
Handlers can be declared inline with no performance penalty. As with attributes, directive values may be quoted for the sake of syntax highlighters.
```html
<button on:click="{() => count += 1}">
count: {count}
</button>
```
---
Add *modifiers* to DOM events with the `|` character.
The following modifiers are available:
* `preventDefault` — calls `event.preventDefault()` before running the handler
* `stopPropagation` — calls `event.stopPropagation()`, preventing the event reaching the next element
* `passive` — improves scrolling performance on touch/wheel events (Svelte will add it automatically where it's safe to do so)
* `capture` — fires the handler during the *capture* phase instead of the *bubbling* phase
* `once` — remove the handler after the first time it runs
Modifiers can be chained together, e.g. `on:click|once|capture={...}`.
```html
<form on:submit|preventDefault={handleSubmit}>
<!-- the `submit` event's default is prevented,
so the page won't reload -->
</form>
```
---
If the `on:` directive is used without a value, the component will *forward* the event, meaning that a consumer of the component can listen for it.
```html
<button on:click>
The component itself will emit the click event
</button>
```
### Component events
* `on:eventname={handler}`
---
Components can emit events using [createEventDispatcher](#docs/createEventDispatcher), or by forwarding DOM events. Listening for component events looks the same as listening for DOM events:
```html
<SomeComponent on:whatever={handler}/>
```
### Element bindings
* `bind:property={value}`
---
Data ordinarily flows down, from parent to child. The `bind:` directive allows data to flow the other way, from child to parent. Most bindings are specific to particular elements.
The simplest bindings reflect the value of a property, such as `input.value`.
```html
<input bind:value={name}>
<textarea bind:value={text}></textarea>
<input type="checkbox" bind:checked={yes}>
```
---
If the name matches the value, you can use a shorthand.
```html
<!-- These are equivalent -->
<input bind:value={value}>
<input bind:value>
```
---
Numeric input values are coerced; even though `input.value` is a string as far as the DOM is concerned, Svelte will treat it as a number.
```html
<input type="number" bind:value={num}>
<input type="range" bind:value={num}>
```
---
Inputs that work together can use `bind:group`.
```html
<script>
let tortilla = 'Plain';
let fillings = [];
</script>
<!-- grouped radio inputs are mutually exclusive -->
<input type="radio" bind:group={tortilla} value="Plain">
<input type="radio" bind:group={tortilla} value="Whole wheat">
<input type="radio" bind:group={tortilla} value="Spinach">
<!-- grouped checkbox inputs populate an array -->
<input type="checkbox" bind:group={fillings} value="Rice">
<input type="checkbox" bind:group={fillings} value="Beans">
<input type="checkbox" bind:group={fillings} value="Cheese">
<input type="checkbox" bind:group={fillings} value="Guac (extra)">
```
---
A `<select>` value binding corresponds to the `value` property on the selected `<option>`, which can be any value (not just strings, as is normally the case in the DOM).
```html
<select bind:value={selected}>
<option value={a}>a</option>
<option value={b}>b</option>
<option value={c}>c</option>
</select>
```
---
A `<select multiple>` element behaves similarly to a checkbox group.
```html
<select multiple bind:value={fillings}>
<option value="Rice">Rice</option>
<option value="Beans">Beans</option>
<option value="Cheese">Cheese</option>
<option value="Guac (extra)">Guac (extra)</option>
</select>
```
---
When the value of an `<option>` matches its text content, the attribute can be omitted.
```html
<select multiple bind:value={fillings}>
<option>Rice</option>
<option>Beans</option>
<option>Cheese</option>
<option>Guac (extra)</option>
</select>
```
---
Media elements (`<audio>` and `<video>`) have their own set of bindings — four *readonly* ones...
* `duration` (readonly) — the total duration of the video, in seconds
* `buffered` (readonly) — an array of `{start, end}` objects
* `seekable` (readonly) — ditto
* `played` (readonly) — ditto
...and three *two-way* bindings:
* `currentTime` — the current point in the video, in seconds
* `paused` — this one should be self-explanatory
* `volume` — a value between 0 and 1
```html
<video
src={clip}
bind:duration
bind:buffered
bind:seekable
bind:played
bind:currentTime
bind:paused
bind:volume
></video>
```
---
Block-level elements have readonly `clientWidth`, `clientHeight`, `offsetWidth` and `offsetHeight` bindings, measured using a technique similar to [this one](http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/).
```html
<div bind:offsetWidth={width} bind:offsetHeight={height}>
<Chart {width} {height}/>
</div>
```
---
To get a reference to a DOM node, use `bind:this`.
```html
<script>
import { onMount } from 'svelte';
let canvasElement;
onMount(() => {
const ctx = canvasElement.getContext('2d');
drawStuff(ctx);
});
</script>
<canvas bind:this={canvasElement}></canvas>
```
### Component bindings
* `bind:property={value}`
You can bind to component props using the same mechanism.
```html
<Keypad bind:value={pin}/>
```
---
Components also support `bind:this`, allowing you to interact with component instances programmatically.
(Note that we can do `{cart.empty}` rather than `{() => cart.empty()}`, since there is no `this` inside a component's `<script>` block.)
```html
<ShoppingCart bind:this={cart}/>
<button on:click={cart.empty}>
Empty shopping cart
</button>
```
### Classes
* `class:name={value}`
* `class:name`
---
A `class:` directive provides a shorter way of toggling a class on an element.
```html
<!-- These are equivalent -->
<div class="{active ? 'active' : ''}">...</div>
<div class:active={active}>...</div>
<!-- Shorthand, for when name and value match -->
<div class:active>...</div>
```
### Actions
* `use:action`
* `use:action={parameters}`
```js
action = (node: HTMLElement, parameters: any) => {
update?: (parameters: any) => void,
destroy: () => void
}
```
---
Actions are functions that are called when an element is created. They must return an object with a `destroy` method that is called after the element is unmounted:
```html
<script>
function foo(node) {
// the node has been mounted in the DOM
return {
destroy() {
// the node has been removed from the DOM
}
};
}
</script>
<div use:foo></div>
```
---
An action can have parameters. If the returned value has an `update` method, it will be called whenever those parameters change, immediately after Svelte has applied updates to the markup.
> Don't worry about the fact that we're redeclaring the `foo` function for every component instance — Svelte will hoist any functions that don't depend on local state out of the component definition.
```html
<script>
export let bar;
function foo(node, bar) {
// the node has been mounted in the DOM
return {
update(bar) {
// the value of `bar` has changed
},
destroy() {
// the node has been removed from the DOM
}
};
}
</script>
<div use:foo={bar}></div>
```
### TODO
* transitions
* animations
* slots
* special elements

@ -171,12 +171,12 @@
} }
.sidebar { .sidebar {
padding: var(--top-offset) 3.2rem var(--top-offset) 0; padding: var(--top-offset) 0;
font-family: var(--font); font-family: var(--font);
overflow-y: auto; overflow-y: auto;
height: 100%; height: 100%;
bottom: auto; bottom: auto;
width: calc(var(--sidebar-w) + 5rem); width: 100%;
} }
.content { .content {
@ -186,7 +186,7 @@
.content :global(.side-by-side) { .content :global(.side-by-side) {
display: grid; display: grid;
grid-template-columns: 50% 50%; grid-template-columns: calc(50% - 0.5em) calc(50% - 0.5em);
grid-gap: 1em; grid-gap: 1em;
} }
} }
@ -284,6 +284,14 @@
fill: none; fill: none;
} }
section > :global(.code-block)> :global(pre) {
background: transparent;
color: white;
padding: 0;
border: none;
box-shadow: none;
}
/* max line-length ~60 chars */ /* max line-length ~60 chars */
section > :global(p) { section > :global(p) {
max-width: var(--linemax) max-width: var(--linemax)
@ -301,11 +309,10 @@
small a { all: unset } small a { all: unset }
small a:before { all: unset } small a:before { all: unset }
section :global(blockquote) { section :global(blockquote) {
color: hsl(204, 100%, 50%); color: hsl(204, 100%, 50%);
border: 2px solid var(--flash); border: 2px solid var(--flash);
padding-left: 8.8rem; /* padding-left: 8.8rem; */
} }
section :global(blockquote) :global(code) { section :global(blockquote) :global(code) {

@ -39,7 +39,7 @@ pre[class*='language-'] {
overflow: auto; overflow: auto;
padding: 1.5rem 2rem; padding: 1.5rem 2rem;
margin: .8rem 0 2.4rem; margin: .8rem 0 2.4rem;
max-width: var(--code-w); /* max-width: var(--code-w); */
border-radius: var(--border-r); border-radius: var(--border-r);
box-shadow: 1px 1px 0.1rem rgba(68, 68, 68, 0.05) inset; box-shadow: 1px 1px 0.1rem rgba(68, 68, 68, 0.05) inset;
} }

Loading…
Cancel
Save