https://github.com/ShadOoW/web-starter-kit
An opinionated starter kit with styled-system, graphql-hooks, mobx and nextjs (PWA)
https://github.com/ShadOoW/web-starter-kit
boilerplate graphql-client i18next mobx nextjs pwa react rtl server-side-rendering styled-components styled-system
Last synced: 10 months ago
JSON representation
An opinionated starter kit with styled-system, graphql-hooks, mobx and nextjs (PWA)
- Host: GitHub
- URL: https://github.com/ShadOoW/web-starter-kit
- Owner: ShadOoW
- Created: 2019-07-23T10:15:33.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:56:26.000Z (over 3 years ago)
- Last Synced: 2025-04-09T22:46:47.723Z (about 1 year ago)
- Topics: boilerplate, graphql-client, i18next, mobx, nextjs, pwa, react, rtl, server-side-rendering, styled-components, styled-system
- Language: JavaScript
- Homepage: https://web-starter-kit-nextjs.herokuapp.com/
- Size: 3.84 MB
- Stars: 17
- Watchers: 1
- Forks: 1
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Demo
# Starter Kit
A starter kit for a next js project.
## Motivation
I love react, but I also love pages that load fast (static sites), this is my attempt at getting the best of both worlds (or as much as possible).
Enter nextjs with SSR and Hydration.
[Read More](https://medium.com/better-programming/next-js-react-server-side-rendering-done-right-f9700078a3b6) if you are unfamiliar with the idea.
Note that for maximum performance, you may want to look at [Partial hydration](https://medium.com/@luke_schmuke/how-we-achieved-the-best-web-performance-with-partial-hydration-20fab9c808d5) techniques, and remove some dependencies.
## CSS
From my experience working as frontend dev, CSS is always the black sheep of the web stack, most people underestimate it and tend to avoid learning it, it doesn't help that browser encourage you to write bad CSS, "if it works, then it most be correct" is the dominant mindset in most teams.
CSS is not simple nor is it boring, it is fun and alive, new tools and techniques are always emerging, without a basic understanding of the fundamentals, this techniques will not help you write better css.
The fundamental struggle in CSS is always the same, we need to write code that makes sense to humans, to allow maintainability, but we need to write code that is performent to speed up the time it takes for the page to load on the user's device.
One good news though is that not every website needs aggressive CSS optimization, most of the time we do have room for improving maintainability.
Many patterns have emerged to solve this fundamental struggle:
### Atomic CSS (ex: [https://acss.io/](https://acss.io))
This technique is one of the best when writing CSS as CSS, by creating a class for each CSS property, we can reuse code everywhere, it also improves readability of HTML
```HTML
Hello
```
vs
```HTML
Hello
```
As a developer I can tell what is the layout of the div in the second example just by looking at the HTML, while in the first example I would need to find the `.box` class to get the same information.
We could use a scale (0, 5px, 10px, 20px...) to standardize spaces and allow css reusability (padding-0, padding-0-5, padding-1, padding-2...), but for this to work, the designer and the programmer need to be fully synced and work hand in hand, which is not always possible.
This technique also supports media queries.
```HTML
This div will have display: none, on mobile and display: flex on medium and above
```
This is possible, because media queries are usually standardized by most designers.
Finally if for some reason something can't be atomic, then you can always use good old css, because atomic css will improve performance as long as the property is used twice or more in the same page, you can also mix and match `