Skip to content

Commit

Permalink
Merge pull request #80 from joshdales/use-deno
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdales authored Nov 17, 2024
2 parents 7449bb0 + e49d688 commit 587babf
Show file tree
Hide file tree
Showing 9 changed files with 271 additions and 274 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Deno
uses: denoland/setup-deno@v2
with:
version: 9
run_install: false
deno-version: v2.x

- name: Install Node.js
uses: actions/setup-node@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
node-version: '20.x'
cache: pnpm
path: |
~/.deno
~/.cache/deno
key: ${{ hashFiles('deno.lock') }}

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Deps
run: deno install

- name: Build CSS
run: pnpm build
run: deno task build

- name: Check if CSS is up to date
run: |
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Publish
run: pnpm publish --provenance --access public
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.github
website
deno.json
deno.loeck
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ There are a series of classes for text, along with others elements like buttons,

### Customisation
The the element classes this is managed with colour classes: `.red`, `.orange`, `.yellow`, `.green`, `.cyan`, `.blue`, `.purple`, and `.pink`.
Each has numbered `accent` properties and sets the `accent-color` property as well, so you can apply a colour class to parent component or directly on an element to give it that accent, or make your own you just need to add `accent-1` - `accent-8` to a class:
Each has numbered `accent` properties and sets the `accent-color` property as well, so you can apply a colour class to parent component or directly on an element to give it that accent, or make your own you just need to add `accent-1` - `accent-9` to a class:
```css
.colour {
--accent-1: var(--colour-1);
Expand All @@ -97,7 +97,7 @@ The accent variables are often used in the following way on interactive elements
1. `accent-4` The standard accent colour for the element.
2. `accent-3` The accent used when elements are being viewed (either by focus or hover).
3. `accent-2` The element is being activated or interactive with.
4. `accent-8` Contrast colour with the main accent, usually text or background.
4. `accent-9` Contrast colour with the main accent, usually text or background.

If you have a button or input and there is no accent class currently set on the element or a common ancestor then they will fallback to using the neutral colours as their accent.

Expand Down Expand Up @@ -129,4 +129,17 @@ This has been built with newer devices and CSS rules in mind - a lot of the colo
Though if you bowser doesn't support custom properties or the `@supports` rule I guess that you are out of luck 😢. Should be good as long as your browser has been updated since 2016.

## SCSS
There are SCSS variables and mixins provided which you can use if you want to override or change things up. They are there if you want them, the variables are names the same as the custom properties.
There are SCSS variables and mixins provided which you can use if you want to override or change things up. They can be imported from the `/styles` directory, the variables are names the same as the custom properties. However I've not documented any of it yet.

## Development
This project uses Deno for local development.
```bash
# Install dependencies
deno install

# Build the main css file
deno build

# Pass the watch flag to update on any style updates
deno build --watch
```
13 changes: 13 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"imports": {
"sass": "npm:sass@^1.77.5"
},
"tasks": {
"build": "sass --no-source-map ./index.scss ./index.css"
},
"fmt": {
"useTabs": true,
"semiColons": false,
"exclude": ["index.css"]
}
}
144 changes: 144 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 587babf

Please sign in to comment.