Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Enhance Styles 5 #168

Merged
merged 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app.arc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enhance/arc-plugin-enhance

@enhance-styles
filename css/styles.css
config css-config.json
config styleguide.json

@bundles
mux-player 'node_modules/@mux/mux-player'
Expand Down
2 changes: 1 addition & 1 deletion app/api/docs/$$.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import HljsLineWrapper from '../../docs/hljs-line-wrapper.mjs'
const arcdown = new Arcdown({
pluginOverrides: {
markdownItToc: {
containerClass: 'toc mb2 ml-2',
containerClass: 'toc mbe2 mis-2',
listType: 'ul',
},
},
Expand Down
2 changes: 1 addition & 1 deletion app/docs/md/learn/concepts/routing/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The journey of an HTTP request through Enhance isn't complicated, but it's helpf

</doc-callout>

<doc-enhance-diagram class="block mb2">
<doc-enhance-diagram class="block mbe2">
</doc-enhance-diagram>

## Routing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Traditionally, designers and developers have taken to using different scale valu
Fluid scales allow font sizes, margins, padding, and other aspects of layouts to scale in size gradually across a range of viewport sizes, as opposed to changing suddenly at discrete breakpoints via media queries. Taking the previous example with our `h1`, a fluid scale would allow the heading’s font size to scale gradually between 2rem and 4rem based on the current viewport size (as long as that viewport size is between your chosen minimum and maximum width). This approach has been popularized by tools like [Utopia](https://utopia.fyi/).

Here’s an example of a fluid modular scale for type in action — you can also [explore the live version of this demo](https://color-ig2.begin.app)!
<img alt='Animation loop showing a browser window shrink and growing in width, with a typographic scale shrinking and growing in tandem' src='/_public/img/gif/example-fluid-type.gif' class='m-auto mt0 mb0' />
<img alt='Animation loop showing a browser window shrink and growing in width, with a typographic scale shrinking and growing in tandem' src='/_public/img/gif/example-fluid-type.gif' class='mi-auto mb0' />

In addition to gracefully scaling across a range of viewport widths, using fluid type and spacing can reduce the amount of CSS you need to write (especially when it comes to CSS scoped with media queries). Of course, this strategy requires alignment between designers and developers; [the Utopia blog](https://utopia.fyi/blog) has some great reading on this subject.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ getStyles.path() // root-relative path to the .css file

Though `@enhance/arc-plugin-styles` is already a dependency of Enhance, you may want to declare it as a direct dependency of your project:

<div class="mt-1">
<div class="mbs-1">

```bash
npm i @enhance/arc-plugin-styles
Expand Down
8 changes: 4 additions & 4 deletions app/docs/md/unsorted/doc-callout-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This 👇 code block is rendered and highlighted on the server with arcdown + hl
<doc-callout level="info" mark="🤘">
```

<hr class="block mt3 mb3 border1" />
<hr class="block mb3 border1" />

<doc-callout>

Expand Down Expand Up @@ -66,7 +66,7 @@ Luckily Enhance sets you up for success by preconfiguring your app to pass state

</doc-callout>

<hr class="block mt3 mb3 border1" />
<hr class="block mb3 border1" />

Empty "mark", set `mark="none"`.

Expand All @@ -76,7 +76,7 @@ Not all things need emoji. Most things do, but not all.

</doc-callout>

<hr class="block mt3 mb3 border1" />
<hr class="block mb3 border1" />

Callouts can be "thin", too. Add an empty `thin` attribute.

Expand All @@ -86,7 +86,7 @@ This style is good for one-liners

</doc-callout>

<hr class="block mt3 mb3 border1" />
<hr class="block mb3 border1" />

## `<doc-link-callout>` Test

Expand Down
35 changes: 0 additions & 35 deletions app/elements/base-test.mjs

This file was deleted.

163 changes: 0 additions & 163 deletions app/elements/code-editor.mjs

This file was deleted.

26 changes: 0 additions & 26 deletions app/elements/coming-soon-page.mjs

This file was deleted.

21 changes: 0 additions & 21 deletions app/elements/content-container.mjs

This file was deleted.

4 changes: 2 additions & 2 deletions app/elements/doc/callout.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export default function Callout({ html, state }) {
${thin ? 'callout-thin' : ''}
flex
gap-1
items-center
align-items-center
">
${mark.length > 0 && mark !== 'none'
? `<callout-mark class="text2 self-start">${mark}</callout-mark>`
? `<callout-mark class="text2 align-self-start">${mark}</callout-mark>`
: ''}
<div>
<slot></slot>
Expand Down
8 changes: 4 additions & 4 deletions app/elements/doc/showcase.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function DocShowcase({ html, state }) {
} = attrs

const contributorMarkup = contributor
? `<p class="mt0">Contributed by: <a class="underline" href="${contributorUrl}">${contributor}</a></p>`
? `<p class="mbs0">Contributed by: <a class="underline" href="${contributorUrl}">${contributor}</a></p>`
: ''

return html`
Expand Down Expand Up @@ -37,12 +37,12 @@ export default function DocShowcase({ html, state }) {
color: inherit;
}
</style>
<article class="mt0 mb2 p0 p2-lg">
<article class="mbs0 mbe2 p0 p2-lg">
<a href="${url}" target="_blank">
<figure class="mb1">
<figure class="mbe1">
<img src="${image}" alt="" />
</figure>
<h1 class="font-medium mb0">${title}</h1>
<h1 class="font-medium mbe0">${title}</h1>
<p class="leading3">
<slot></slot>
</p>
Expand Down
Loading