Skip to content

Commit d59476c

Browse files
authored
feat: full rewrite of the project (#23)
- Refactor project structure and architecture - Update dependencies - Implement new features and improvements - Clean up legacy code and remove deprecated components
1 parent 44b67e5 commit d59476c

File tree

13 files changed

+250
-196
lines changed

13 files changed

+250
-196
lines changed

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> 0.1%
2+
last 2 versions
3+
not dead
4+
IE > 5

.github/workflows/notify.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
11
name: Notify
22

33
on:
4-
pull_request:
5-
types: [closed]
4+
push:
5+
branches:
6+
- main
67

78
jobs:
89
notify:
9-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
15-
16-
- name: Determine version update type
17-
id: determine_version
18-
run: |
19-
COMMIT_MESSAGE=$(git log -1 --pretty=format:%B)
20-
if [[ "$COMMIT_MESSAGE" == *"[major]"* ]]; then
21-
echo "update_type=major" >> $GITHUB_ENV
22-
elif [[ "$COMMIT_MESSAGE" == *"[minor]"* ]]; then
23-
echo "update_type=minor" >> $GITHUB_ENV
24-
else
25-
echo "update_type=patch" >> $GITHUB_ENV
26-
fi
27-
28-
- name: Send notification to style-forge
13+
- name: Send notification
2914
run: |
3015
curl -X POST \
3116
-H "Accept: application/vnd.github.v3+json" \
3217
-H "Authorization: token ${{ secrets.NOTIFY_GITHUB_TOKEN }}" \
3318
https://api.github.com/repos/Style-Forge/hub/dispatches \
34-
-d '{"event_type":"update-style-forge", "client_payload": {"update_type": "${{ env.update_type }}", "package_name": "style-forge.base"}}'
19+
-d '{"event_type":"update-style-forge", "client_payload": {"package_name": "style-forge.base"}}'

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Publish
22

33
on:
4-
pull_request:
5-
types: [closed]
4+
push:
5+
tags:
6+
- '*.*.*'
67

78
jobs:
89
publish:
9-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
1010
runs-on: ubuntu-latest
1111

1212
steps:

.github/workflows/release.yml

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*.*.*'
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
78

89
permissions:
910
contents: write
10-
pull-requests: write
1111

1212
jobs:
1313
release:
14+
if: github.event.pull_request.merged == true
1415
runs-on: ubuntu-latest
1516

1617
steps:
@@ -26,57 +27,19 @@ jobs:
2627
- name: Install dependencies
2728
run: yarn install --frozen-lockfile
2829

29-
- name: Configure Git
30+
- name: Extract version from package.json
31+
id: extract_version
3032
run: |
31-
git config --global user.name 'github-actions'
32-
git config --global user.email '[email protected]'
33-
34-
- name: Fetch all tags
35-
run: git fetch --tags
36-
37-
- name: Extract version and previous tag
38-
id: extract_info
39-
run: |
40-
VERSION=${GITHUB_REF#refs/tags/v}
41-
PREVIOUS_TAG=$(git describe --tags $(git rev-list --tags --skip=1 --max-count=1))
33+
VERSION=$(jq -r '.version' package.json)
4234
echo "VERSION=$VERSION" >> $GITHUB_ENV
43-
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
44-
45-
- name: Determine update type
46-
id: determine_update_type
47-
run: |
48-
IFS='.' read -r -a NEW_VERSION_PARTS <<< "${VERSION}"
49-
IFS='.' read -r -a OLD_VERSION_PARTS <<< "${PREVIOUS_TAG#v}"
50-
51-
if [ "${NEW_VERSION_PARTS[0]}" != "${OLD_VERSION_PARTS[0]}" ]; then
52-
UPDATE_TYPE=major
53-
elif [ "${NEW_VERSION_PARTS[1]}" != "${OLD_VERSION_PARTS[1]}" ]; then
54-
UPDATE_TYPE=minor
55-
else
56-
UPDATE_TYPE=patch
57-
fi
58-
echo "UPDATE_TYPE=$UPDATE_TYPE" >> $GITHUB_ENV
5935
60-
- name: Create and push new branch
36+
- name: Create Git tag
6137
run: |
62-
NEW_BRANCH=release-v${VERSION}
63-
git checkout -b ${NEW_BRANCH}
64-
git push origin ${NEW_BRANCH}
65-
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV
66-
67-
- name: Update version in package.json
68-
run: jq --arg new_version "$VERSION" '.version = $new_version' package.json > temp.json && mv temp.json package.json
38+
git tag -a "$VERSION" -m "Release $VERSION"
39+
git push origin "$VERSION"
6940
7041
- name: Build the package
7142
run: yarn build
7243

73-
- name: Create Pull Request
74-
uses: peter-evans/create-pull-request@v6
75-
with:
76-
token: ${{ secrets.GITHUB_TOKEN }}
77-
commit-message: "Update version to ${{ env.VERSION }} [${{ env.UPDATE_TYPE }}] and upgrade dependencies"
78-
branch: ${{ env.NEW_BRANCH }}
79-
base: main
80-
title: "Release ${{ env.VERSION }}"
81-
body: "This PR updates the version to ${{ env.VERSION }} and upgrades dependencies."
82-
labels: release
44+
- name: Notify release
45+
run: echo "Release ${{ env.VERSION }} has been successfully created."

builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const [from, to] = ['src/all.css', 'base.css']
99
const css = fs.readFileSync(from, 'utf8')
1010

1111
const packageFile = JSON.parse(fs.readFileSync('package.json', 'utf8'))
12-
const title = packageFile.name + ' v' + packageFile.version
12+
const title = packageFile.name + ' ' + packageFile.version
1313
const license = packageFile.license + ' License'
1414
const link = packageFile.repository.url.replace('git+', '').replace('.git', '')
1515
const header = '/*! ' + [title, license, link].join(' | ') + ' */'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "style-forge.base",
3-
"version": "5.3.6",
3+
"version": "2025.01.03",
44
"description": "Style-Forge.Base: foundational CSS variables, base styles, typography, colors, utilities for consistent design.",
55
"type": "module",
66
"main": "base.css",

src/form.css

Lines changed: 80 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
::file-selector-button,
21
button,
32
input,
43
optgroup,
@@ -12,57 +11,97 @@ textarea
1211
line-height: 1;
1312

1413
text-transform: none;
14+
vertical-align: top;
1515
}
1616

17-
button,
18-
:where(input:not(
19-
[type='checkbox'],
20-
[type='color'],
21-
[type='file'],
22-
[type='hidden'],
23-
[type='image'],
24-
[type='radio'],
25-
[type='range']
26-
)),
27-
optgroup,
28-
option,
2917
select,
18+
button,
19+
input,
3020
textarea
31-
{ padding: 0.25em 0.5em }
32-
33-
::file-selector-button,
34-
:where(button, select),
35-
:where(input):where(
36-
[type='button'],
37-
[type='checkbox'],
38-
[type='color'],
39-
[type='file'],
40-
[type='image'],
41-
[type='radio'],
42-
[type='range'],
43-
[type='reset'],
44-
[type='submit']
45-
)
46-
{ cursor: pointer }
47-
48-
:disabled,
49-
:disabled::file-selector-button
5021
{
51-
cursor: not-allowed;
52-
-webkit-tap-highlight-color: transparent;
22+
padding: 0 0.75em;
23+
min-height: 32px;
5324
}
5425

55-
fieldset {
56-
padding: 1em;
57-
border: 1px solid hsl(var(--sf-fieldset-c-bd));
26+
select[multiple] option,
27+
select[multiple] optgroup
28+
{
29+
margin: 0 -0.75em;
30+
padding: 0.4em 0.75em;
5831
}
32+
select[multiple] optgroup option { margin: 0 }
5933

60-
legend {
61-
color: inherit;
62-
padding: 0 0.5em;
34+
input[type='checkbox'],
35+
input[type='color'],
36+
input[type='file'],
37+
input[type='hidden'],
38+
input[type='image'],
39+
input[type='radio'],
40+
input[type='range']
41+
{
42+
margin: 0;
43+
padding: 0;
44+
min-height: 32px;
6345
}
6446

65-
progress { vertical-align: baseline }
47+
input[type='checkbox'],
48+
input[type='radio'],
49+
textarea
50+
{ min-height: auto }
51+
52+
53+
button,
54+
select,
55+
input[type='button'],
56+
input[type='reset'],
57+
input[type='submit'],
58+
input[type='checkbox'],
59+
input[type='color'],
60+
input[type='file'],
61+
input[type='image'],
62+
input[type='radio'],
63+
input[type='range']
64+
{ cursor: pointer }
65+
66+
button,
67+
input[type='button'],
68+
input[type='reset'],
69+
input[type='submit'],
70+
input[type='checkbox'],
71+
input[type='radio']
72+
{ vertical-align: baseline }
73+
74+
input[type='checkbox'] { margin: 0 3px 0 0.5em }
75+
input[type='radio'] { margin: 0 3px 0 0.5em }
6676

77+
fieldset { padding: 1em; border: 0 }
78+
legend { color: inherit; padding: 0 0.5em }
6779
textarea { overflow: auto }
6880

81+
::file-selector-button {
82+
cursor: pointer;
83+
font-size: inherit;
84+
font-family: inherit;
85+
font-weight: 400;
86+
line-height: 1;
87+
88+
padding: 0 0.75em;
89+
min-height: 32px;
90+
91+
text-transform: none;
92+
vertical-align: baseline;
93+
}
94+
95+
::file-selector-button:disabled {
96+
cursor: not-allowed;
97+
-webkit-tap-highlight-color: transparent;
98+
}
99+
100+
:disabled,
101+
input:disabled,
102+
button:disabled,
103+
select:disabled
104+
{
105+
cursor: not-allowed;
106+
-webkit-tap-highlight-color: transparent;
107+
}

src/link.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ a:not([href]) {
1010
opacity: var(--sf-disabled);
1111
-webkit-tap-highlight-color: transparent;
1212
}
13+
14+
/* /// */
15+
16+
html.var a { color: hsl(225, 73%, 57%) }
17+
html.var a:not([href]) { opacity: 0.4 }

src/table.css

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
table {
22
display: table;
33
border-collapse: collapse;
4+
5+
font-size: inherit;
6+
line-height: var(--sf-lh-normal);
7+
8+
border-width: 0 1px 1px 0;
9+
410
border-spacing: 0;
511
}
612

7-
tbody,
8-
tfoot,
9-
thead
10-
{ background: none }
13+
table, td, th { border: 1px solid hsl(var(--sf-table-c-bd)) }
14+
tbody, tfoot, thead { background: none }
15+
td, th { padding: 0.5em 0.75em }
1116

12-
td,
13-
th
14-
{
15-
padding: 0.5em 0.75em;
16-
border: 1px solid hsl(var(--sf-table-c-bd));
17-
}
17+
td:not([align]), th:not([align]) { text-align: start }
18+
td:not([valign]), th:not([valign]) { vertical-align: top }
19+
20+
/* /// */
1821

19-
td:not([align]),
20-
th:not([align])
21-
{ text-align: start }
22+
html.var table,
23+
html.var td,
24+
html.var th
25+
{ border: 1px solid hsl(0, 0%, 75%) }
2226

23-
td:not([valign]),
24-
th:not([valign])
25-
{ vertical-align: top }
27+
html.var table { line-height: 1.1875 }

0 commit comments

Comments
 (0)