Skip to content
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
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
last 2 versions
not dead
> 0.2%
54 changes: 54 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# EditorConfig is awesome: https://editorconfig.org

root = true

# Global settings for all files
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

# CSS, SCSS, Less
[*.{css,scss,less}]
indent_size = 2
max_line_length = 100

# JavaScript / TypeScript (future-proof)
[*.{js,jsx,ts,tsx,mjs,cjs}]
indent_size = 2
max_line_length = 100
quote_type = single

# JSON files (Prettier handles formatting)
[*.{json,json5,jsonc}]
indent_size = 2
max_line_length = 0

# YAML (e.g., GitHub Actions)
[*.{yml,yaml}]
indent_size = 2
max_line_length = 120

# Markdown (preserve trailing spaces for line breaks)
[*.md]
trim_trailing_whitespace = false
indent_size = 2
max_line_length = 80

# GitHub Actions workflows (YAML)
[.github/**/*.yml]
indent_size = 2
max_line_length = 120

# Dotfiles with no extension (.gitignore, .browserslistrc, etc.)
[*.{gitignore,browserslistrc}]
indent_size = 2
trim_trailing_whitespace = true

# Shell scripts
[*.{sh,bash}]
indent_size = 2
end_of_line = lf
92 changes: 46 additions & 46 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,51 @@
version: 2

updates:
- package-ecosystem: "npm"
directory: "/" # root of the repository
schedule:
interval: "weekly" # check once a week (on Monday)
day: "monday"
time: "08:00"
timezone: "Europe/London"
versioning-strategy: "increase" # prefer updating to the next semver range
target-branch: "main" # PRs will target the main branch
labels:
- "dependencies"
- "npm"
commit-message:
prefix: "chore(deps)"
prefix-development: "chore(deps-dev)"
include: "scope" # include the package name in the commit message
- package-ecosystem: 'npm'
directory: '/' # root of the repository
schedule:
interval: 'weekly' # check once a week (on Monday)
day: 'monday'
time: '08:00'
timezone: 'Europe/London'
versioning-strategy: 'increase' # prefer updating to the next semver range
target-branch: 'main' # PRs will target the main branch
labels:
- 'dependencies'
- 'npm'
commit-message:
prefix: 'chore(deps)'
prefix-development: 'chore(deps-dev)'
include: 'scope' # include the package name in the commit message

# Group all development dependencies into a single PR to reduce noise
groups:
dev-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
# Ignore specific packages if needed (example)
ignore:
- dependency-name: "lightningcss"
# keep it on the latest major version (optional)
# Limit the number of open PRs
open-pull-requests-limit: 10
# Group all development dependencies into a single PR to reduce noise
groups:
dev-dependencies:
dependency-type: 'development'
update-types:
- 'minor'
- 'patch'
# Ignore specific packages if needed (example)
ignore:
- dependency-name: 'lightningcss'
# keep it on the latest major version (optional)
# Limit the number of open PRs
open-pull-requests-limit: 10

# ----------------------------
# GitHub Actions (workflows)
# ----------------------------
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "08:00"
timezone: "Europe/London"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "chore(ci)"
include: "scope"
open-pull-requests-limit: 5
# ----------------------------
# GitHub Actions (workflows)
# ----------------------------
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
time: '08:00'
timezone: 'Europe/London'
labels:
- 'dependencies'
- 'github-actions'
commit-message:
prefix: 'chore(ci)'
include: 'scope'
open-pull-requests-limit: 5
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main

jobs:
quality-checks:
name: Lint, Format & Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24.x'
cache: 'npm'

- name: Install dependencies (clean install)
run: npm ci

- name: Run Stylelint (CSS linting)
run: npm run lint

- name: Check Prettier formatting
run: npm run format -- --check

- name: Build package (verify it compiles)
run: npm run build
47 changes: 34 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
# Publish to npm when a release is published or manually triggered.
# Also verifies version consistency, runs linters, builds the package, and publishes with provenance.
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:
types: [published] # triggers when a GitHub Release is published
workflow_dispatch: # allows manual trigger from Actions tab

jobs:
publish:
name: Build & Publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
id-token: write # required for npm provenance

steps:
- name: 'Checkout code'
- name: Checkout repository
uses: actions/checkout@v7

- name: 'Setup Node.js'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: 'Install dependencies'
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies (clean install)
run: npm ci

# - name: 'Build'
# run: npm run build
# - name: 'Test'
# run: npm test
- name: Verify version matches the release tag (if triggered by release)
if: github.event_name == 'release'
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
RELEASE_TAG=${github.event.release.tag_name#v}
if [ "$PACKAGE_VERSION" != "$RELEASE_TAG" ]; then
echo "❌ Package version ($PACKAGE_VERSION) does not match release tag ($RELEASE_TAG)"
exit 1
fi
echo "✅ Package version $PACKAGE_VERSION matches release tag $RELEASE_TAG"

- name: Run Stylelint (CSS linting)
run: npm run lint

- name: Check Prettier formatting
run: npm run format -- --check

- name: Build package
run: npm run build

- name: 'Publish to npm'
- name: Publish to npm with provenance
run: npm publish --provenance --access public
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
*.log
package-lock.json
.DS_Store
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
12 changes: 12 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": ["stylelint-config-standard", "stylelint-prettier/recommended"],
"plugins": ["stylelint-order"],
"rules": {
"order/properties-alphabetical-order": true,
"declaration-block-no-redundant-longhand-properties": true,
"no-descending-specificity": null,
"selector-class-pattern": null,
"value-keyword-case": ["lower", { "ignoreProperties": ["/^--/"] }]
},
"ignoreFiles": ["dist/**/*.css"]
}
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,29 @@ Alternatively, download the files manually from the repository.
## Usage

At the very beginning of the CSS file:

```css
@import '~@comfortcss/reset';
```

For example, just the basic reset and forms:

```css
@import "~@comfortcss/reset/reset";
@import "~@comfortcss/reset/modules/core/base.css";
@import '~@comfortcss/reset/reset';
@import '~@comfortcss/reset/modules/core/base.css';
```

## Modules

| Module | Description |
|--------|-------------|
|base|Box model, html, body, system colors|
|typography|Headings, paragraphs, lists, quotes, code, hr|
|forms|All input fields, buttons, select elements, and textareas|
|tables|Tables, cells, captions|
|media|Images, videos, iframes, SVG, audio|
|interactive|Links, focus, hidden, disabled, contenteditable|
|accessibility|prefers-reduced-motion, system @property|
| Module | Description |
| ------------- | --------------------------------------------------------- |
| base | Box model, html, body, system colors |
| typography | Headings, paragraphs, lists, quotes, code, hr |
| forms | All input fields, buttons, select elements, and textareas |
| tables | Tables, cells, captions |
| media | Images, videos, iframes, SVG, audio |
| interactive | Links, focus, hidden, disabled, contenteditable |
| accessibility | prefers-reduced-motion, system @property |

## License

Expand Down
2 changes: 1 addition & 1 deletion example/css/index.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import url('../../dist/reset.min.css');
@import url('../../dist/reset.min.css');
46 changes: 23 additions & 23 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<a href="#">Back to index</a>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example</title>
<link rel="stylesheet" href="css/index.css" />
</head>
<body>
<a href="#">Back to index</a>

<h1>Example</h1>
<p>This is an example page.</p>
<h1>Example</h1>
<p>This is an example page.</p>

<h2>Subheading</h2>
<h3>Another subheading</h3>
<h4>Yet another subheading</h4>
<h5>Subheading level 5</h5>
<h6>Subheading level 6</h6>

<button>Click me</button>
<input type="text" placeholder="Type something...">
<textarea placeholder="Type something..."></textarea>
<h2>Subheading</h2>
<h3>Another subheading</h3>
<h4>Yet another subheading</h4>
<h5>Subheading level 5</h5>
<h6>Subheading level 6</h6>

<img src="https://placehold.co/600x400" alt="Placeholder Image">
</body>
</html>
<button>Click me</button>
<input type="text" placeholder="Type something..." />
<textarea placeholder="Type something..."></textarea>

<img src="https://placehold.co/600x400" alt="Placeholder Image" />
</body>
</html>
Loading