Giter Club home page Giter Club logo

fortune's Introduction

sapper-blog-template

A portfolio template for building markdown-powered blogs with Sapper and Svelte.

👉 Demo

✨ Getting started

npx degit atav1k/atav1k my-blog
cd my-blog
npm install # or yarn!
npm run dev

Open up localhost:3000 and start clicking around.

Consult sapper.svelte.dev for help getting started.

🏗 Structure

The base structure of this template is the same as Sapper's default template. These are some of the new things you'll find here:

src/routes/blog

This is the home of your blog. The most important files in here are:

  • _posts.js: this module contains the logic for loading and parsing your markdown posts.
  • [slug].svelte: this is the template of your blog post page.
  • index.svelte: this is the template of your article list page.

src/routes/blog/posts

This is where your markdown posts live in. All .md files in this directory are treated as blog posts and parsed automatically by the _posts.js module.

  • The markdown file name becomes the post slug. For example hello-world.md becomes http://localhost:3000/blog/hello-world.
  • Everything between the start of the post and the <!-- more --> tag becomes the article's "excerpt".
  • Frontmatter properties supported are title and date.

fortune's People

Contributors

chasestarr avatar vikramrojo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fortune's Issues

Class names inconsistency

Should margins, padding, border, transforms be changed from p- | m- | b- | t- => pad-t- | mar-t- | border-t- | trans-t-| for beginner readability. This would be a breaking change.

Add debugging class

In the recent article, I published: https://medium.freecodecamp.org/learn-this-one-weird-trick-to-debug-css-88529aa5a6a3 I talked about a global CSS debugger. Another method of using this, however, is scoped to an element and its children. E.g.

.debug *:not(path):not(g) {
	color:                    hsla(210, 100%, 100%, 0.9) !important;
	background:               hsla(210, 100%,  50%, 0.5) !important;
	outline:    solid 0.25rem hsla(210, 100%, 100%, 0.5) !important;

	box-shadow: none !important;
}

The difference here is that now whatever is classed as .debug so will it and its children expose the debugger, which could also be customized using CSS variables (such as color).

Make the source compartmentalized

You can make your package compartmentalized, sort of similar to Bulma (but this was specified in Sass, not in the URL), in making the source specifiable via a query.

E.g. fortune.css?all.css or fortune.css?helpers.css so the emphasis is on what do I need versus not need––not give me the whole thing. This is similar to how jQuery had a light version.

This is also brilliant for teaching how to use Fortune in steps; start with some subset of the package and then work up to the whole thing.

Extended spacing systems with fallback

Proposal to change spacing classes to a singular class .marX with modifier isSpace allowing for a more memorable spacing utility. Early explorations ran into limitations with destructiveness in children which required swapping css variables & resetting children.

:root {
  --gap-1: 2rem;
  --gap-2: 4rem;
}

.isSpace {
  --space-1: 4rem;
  --space-2: 6rem;
}

.isSpace * {
  --space-1: initial;
  --space-2: initial;
}

.mar1 {
  margin: var(--space-1, var(--gap-1));
}

.mar2 {
  margin: var(--space-2, var(--gap-2));
}

Shorthand and longhand versions

Given Bulma and Bootstrap are opposites on the spectrum in terms of naming conventions, why not make fortune have a longhand and shorthand counterpart, one being semantically optimized for prototyping (shorthand) and one being semantically optimized for maintainability (longhand). I can't say I'm a fan of m- and p- classes for margin and padding but I can see the benefit.

E.g. bkg and background available in fortune.shorthand.css and fortune.longhand.css

CSS in JS

What can we learn from css-blocks.com about fortune handling jsx?

Variable CSS Reset

I'm wondering if you could exploit CSS variables to make the reset used itself specifiable.

E.g. --reset: var(--normalize); etc.

Given it can be opinionated, this could be really exciting!

Nav purpose

Nav assumes to be an element but is actually a top nav implementation. Possibly extend to add an 'isAside'?

Add inline documentation

If you've ever looked at the official implementation for the Go standard library, one interesting decision the Go team advocates for is inline documentation, that is documenting the nature of the code so that is can be learnable in its context. See for example here: https://golang.org/src/text/template/parse/parse.go?s=6091:6230#L218

I recommend doing the same for the start of repeating classes, e.g. class-1, class-2, ... so that users don't require further documentation.

Add more components

Looking at mustard specs, we could include:

  • Breadcrumb
  • Card
  • Dropdown
  • Pagination
  • Modal
  • Progress
  • Stepper
  • Tooltip
  • Media

Exposing component variables

When using a viewport scroll monitor how can you direct variables values, eg. button-bg-color to either transition change or with button-padding-y through incremental values.

Utility class for nudging

Positioning needs a nudge class for gap spaces. Suggesting gt-1 & using margins going from 0-12px.

max width helper classes

i've found myself writing <div style="max-width: XXpx" /> a couple times today. might be useful to include this util

Mobile optimizations

Placeholder for mobile conversations, eg. how to handle @custom-media --breakpoint & --heading-font

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.