Skip to content

Commit

Permalink
Change name to Syss with a bunch of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonmaur committed Apr 11, 2023
1 parent 9426045 commit e55e416
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 282 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 98

[*.md]
trim_trailing_whitespace = false
Expand Down
9 changes: 0 additions & 9 deletions .gitattributes

This file was deleted.

11 changes: 0 additions & 11 deletions .github/logo.svg

This file was deleted.

27 changes: 14 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master

on: [push, pull_request]

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [1.45.0, 1.57.0, 1.61.0]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install sass

- name: Install Sass
run: |
curl -LO https://github.com/sass/dart-sass/releases/download/1.45.0/dart-sass-1.45.0-linux-x64.tar.gz
tar -xzf dart-sass-1.45.0-linux-x64.tar.gz
curl -LO https://github.com/sass/dart-sass/releases/download/${{ matrix.version }}/dart-sass-${{ matrix.version }}-linux-x64.tar.gz
tar -xzf dart-sass-${{ matrix.version }}-linux-x64.tar.gz
echo "$PWD/dart-sass" >> $GITHUB_PATH
- name: Run tests
run: make test
- run: make test
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
# The directory Sass uses for caching
/.sass-cache/

# Ignore all generated map files
# Ignore all the generated files
*.css
*.css.map
*.sass.map
*.scss.map

# The directory we write compiled artifacts to
/_build/

# The example files sometimes used for manual testing
# The example files used for manual testing
example.*
22 changes: 18 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
Copyright 2021 Maur & Co.
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2023 Maur & Co.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 6 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
.EXPORT_ALL_VARIABLES:
.PHONY: help dev build test test-unit test-integration release
.PHONY: dev build test

help: #: show this help menu
@grep "#:" Makefile* | grep -v "@grep" | sed "s/\([A-Za-z_ -]*\):.*#\(.*\)/$$(tput setaf 3)\1$$(tput sgr0)\2/g"
dev:
@sass index.scss:index.css --embed-source-map --watch

dev: #: watch the source files and rebuild when they change
@sass index.scss:_build/index.css --embed-source-map --watch
build:
@sass index.scss:index.min.css --style=compressed

build: #: build the final output file
@sass index.scss:_build/index.min.css --style=compressed

test: test-unit test-integration #: run testing suite

test-unit: #: run the unit tests
test:
@sass test/test-helper.scss

test-integration: #: run the integration tests
@cd test && ./test-integration.sh

release: build #: build the final output and create a new tagged release
@git tag v$(version)
@git archive \
--format tar.gz \
--prefix ssbuild/ \
--add-file _build/index.min.css \
--add-file _build/index.min.css.map \
--add-file publish/npm/package.json \
v$(version) > _build/npm-ssbuild-$(version).tar.gz
122 changes: 43 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
<div align="center">
⚠️ <b>This project is still under active development. Check back soon for a stable release!</b>
</div>

<br /> <br /> <br /> <br />

<div align="center">
<img src=".github/logo.svg" alt="ssbuild logo" width="300" />
</div>
<a aria-label="test status" href="https://github.com/maurandco/syss/actions/workflows/test.yml">
<img alt="test" src="https://img.shields.io/github/workflow/status/maurandco/syss/Test?label=tests&style=flat-square" />
</a>

<br /> <br />
<a aria-label="version status" href="https://github.com/maurandco/syss/releases">
<img alt="version" src="https://img.shields.io/github/v/release/maurandco/syss?display_name=tag&style=flat-square&color=B85A8A" />
</a>

<p align="center">
A style system generator and utility-first CSS framework built in Sass.
</p>
**⚠️ This project is still under active development. Check back soon for a stable release!**

<p align="center">
<a aria-label="test status" href="https://github.com/maurandco/ssbuild/actions/workflows/test.yml">
<img alt="test" src="https://img.shields.io/github/workflow/status/maurandco/ssbuild/Test?label=tests&style=flat-square" />
</a>
Syss is a style system generator and utility-first CSS framework built entirely in Sass.

<a aria-label="version status" href="https://github.com/maurandco/ssbuild/releases">
<img alt="version" src="https://img.shields.io/github/v/release/maurandco/ssbuild?display_name=tag&style=flat-square&color=B85A8A" />
</a>
</p>

<br /> <br /> <br /> <br />
It was inspired by similar utility-first CSS frameworks such as Tailwind and Tachyons, but it comes with the power of a CSS preprocessor and zero dependencies other than [dart-sass](https://sass-lang.com/dart-sass)—which is fast and self-contained. As opposed to dealing with a Node build system, an "Electron for CLI's" binary, or the plethora of plugins needed for PostCSS.

<details>
<summary><b>Table of contents</b></summary>

- [Features](#features)
- [Why?](#why)
- [Installation](#installation)
- [Usage](#usage)
- [Custom Classes](#custom-classes)
Expand Down Expand Up @@ -72,97 +57,76 @@
- Easily extended with custom Sass.
<!-- - 0kB gzipped and 0kB brotli'd for default build. -->

## Why?

ssbuild was inspired by similar utility-first CSS frameworks such as TailwindCSS and Tachyons, but it comes with the power of a CSS preprocessor and zero dependencies other than [dart-sass](https://sass-lang.com/dart-sass) (which is fast and self-contained). As opposed to dealing with a Node build system, an "Electron for CLI's" binary, or PostCSS with its plethora of plugins.

## Installation

If you don't need any customization and want to start using the utility classes right away, you can link directly to the default build in your HTML:

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@maurandco/ssbuild@0.0/index.min.css" />
<link rel="stylesheet" href="https://unpkg.com/syss@0.1" />
```

If you want to customize your build, you'll need to install ssbuild into your project using one of these methods:
If you want to customize your build, you'll need to install syss into your project using one of these methods:

- [Download the latest release](https://github.com/maurandco/ssbuild/releases)
- Install with [hex](https://hex.pm) (Elixir): _not supported yet_
- Install with [gem](https://rubygems.org) (Ruby): _not supported yet_
- Install with [pip](https://pypi.org) (Python): _not supported yet_
- Install with [npm](https://www.npmjs.com) (Node): `npm install @maurandco/ssbuild`
- [Download the latest release](https://github.com/maurandco/syss/releases)
- Install with [npm](https://www.npmjs.com): `npm install syss`

## Usage

```scss
@use "path/to/ssbuild";
@use "path/to/syss";
```

Use [--load-path](https://sass-lang.com/documentation/cli/dart-sass#load-path) to include the vendor directory for your package management (could be `vendor`, `deps`, `node_modules`, etc.). Then point Sass to the ssbuild directory relative to the vendor directory. That's it! All the utility classes will now be included in your CSS output.
Use [--load-path](https://sass-lang.com/documentation/cli/dart-sass#load-path) to include the vendor directory for your package management (could be `vendor`, `node_modules`, etc.). That's it! All the utility classes will now be included in your CSS output.

```html
<div class="m-5 p-5 bg-gray-8 max-w-6 md:max-w-7">
<h1 class="mb-4 pink-5 text-xxl text-heavy">
Welcome to ssbuild!
Welcome to Syss!
</h1>

<p class="text-sm text-light lead-copy">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
</p>
</div>
```

### Custom Classes

If you find yourself frequently reusing utility classes and want to extract common components into custom classes, you can use the [@extend](https://sass-lang.com/documentation/at-rules/extend) syntax:

```scss
.text-container {
@extend .m-5;
@extend .p-5;
@extend .bg-gray-8;
@extend .max-w-6;
@extend .md\:max-w-7;
}
```

But due to the way `@extend` works, this can create an obscene amount of class names if used too often. A better solution is to access style system values directly using [getters](#getters):
If you find yourself frequently reusing utility classes and want to extract common components into custom classes, you can access style system values directly using Syss [getters](#getters):

```scss
@use "path/to/ssbuild" as ss;
@use "path/to/syss";

.text-container {
background-color: ss.color(gray-8);
max-width: ss.size(6);
padding: ss.space(5);
margin: ss.space(5);
background: syss.color(gray-8);
padding: syss.space(5);

@include ss.media-up-to(md) {
max-width: ss.size(7);
@include syss.media-up-to(md) {
padding: syss.space(6);
}
}
```

## Configuration
## Custom Configuration

If you want to customize the default Syss values, you can pass custom configuration using [`with`](https://sass-lang.com/documentation/at-rules/use#configuration). Note that all custom values will **override the defaults** unless they are configured within the [$extend](#extend) map.

```sass
@use "path/to/ssbuild" with (
@use "path/to/syss" with (
$primary-fonts: (
sans-serif: "Fira Sans",
monospace: "Fira Mono",
monospace: "Fira Mono"
),
$extend: (
brand-colors: (
off-black: #202020,
),
),
off-black: #202020
)
)
);
```

_Note that all custom values will **override the defaults** unless they are configured within the [$extend](#extend) map._

- [$normalize](#normalize)
- [$class-prefix](#class-prefix)
- [$separator](#separator)
Expand Down Expand Up @@ -193,7 +157,7 @@ _Note that all custom values will **override the defaults** unless they are conf
> default: `true`
</details>
Whether to import [modern-normalize](https://github.com/sindresorhus/modern-normalize) and some other [opinionated normalize rules](lib/normalize.scss) at the top of your stylesheet.
Whether to import [modern-normalize](https://github.com/sindresorhus/modern-normalize) and some other [opinionated normalization rules](lib/normalize.scss) at the top of your stylesheet.

### Class Prefix

Expand Down Expand Up @@ -691,8 +655,8 @@ For example:

```scss
.foobar {
color: ssbuild.color(gray-8);
padding: ssbuild.space(4);
color: syss.color(gray-8);
padding: syss.space(4);
}
```

Expand All @@ -711,10 +675,10 @@ These mixins are useful for defining custom breakpoints using the sizes from [$s

```scss
.foobar {
padding: ssbuild.space(4);
padding: syss.space(4);

@include ssbuild.media-up-to(md) {
padding: ssbuild.space(5);
@include syss.media-up-to(md) {
padding: syss.space(5);
}
}
```
Expand All @@ -739,7 +703,7 @@ Will result in:
Generates a media query using `min-width` (the given screen size or _larger_):

```scss
@include ssbuild.media-up-to(md) {}
@include syss.media-up-to(md) {}
```

Will result in:
Expand All @@ -755,7 +719,7 @@ Will result in:
Generates a media query using `max-width` (the given screen size or _smaller_) with 0.5px subtracted from the screen size:

```scss
@include ssbuild.media-down-to(md) {}
@include syss.media-down-to(md) {}
```

Will result in:
Expand All @@ -771,7 +735,7 @@ Will result in:
Generates a media query using `min-width` and `max-width` to target a single screen size:

```scss
@include ssbuild.media-only(md) {}
@include syss.media-only(md) {}
```

Will result in:
Expand All @@ -787,7 +751,7 @@ Will result in:
Generate a media query using `min-width` and `max-width` to target screen sizes between the two specified:

```scss
@include ssbuild.media-between(sm, lg) {}
@include syss.media-between(sm, lg) {}
```

Will result in:
Expand Down
Loading

0 comments on commit e55e416

Please sign in to comment.