Skip to content

Commit f301e5e

Browse files
medevodmedevod
andauthored
Fixes/minor-fixes (#72)
* fix aligment for check, radio and toggle * CICD fix release versioning * update change log * CICD fix syntax err * fix input toggle aligment * CICD cleanup unused steps * fix v aligment rule for check, radio and toggle * doc add zindex sub section * icons adjust border witdth * fix dropdown scroll bar padding * demo update nav * fix fixed font size for all screens * demo reorg nav layout * update dist file * CICD refactor deploy workflow * CICD fix workflow * CICD update deploy action --------- Co-authored-by: medevod <medevod@github.com>
1 parent 750c92a commit f301e5e

20 files changed

Lines changed: 208 additions & 237 deletions

.github/actions/build-action/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ runs:
2424
id: package-version
2525
uses: martinbeentjes/npm-get-version-action@v1.3.1
2626
- name: "build minified main css library, js plugins and demo in standalone mode"
27+
if: ${{ inputs.stage != 'release' }}
2728
env:
2829
PACKAGE_VERSION: v${{ steps.package-version.outputs.current-version }}-${{ inputs.stage }}
2930
run: |
@@ -33,3 +34,14 @@ runs:
3334
parcel build --target demo --no-source-maps --no-content-hash --public-url ./v${{ steps.package-version.outputs.current-version }}-${{ inputs.stage }}
3435
npm run test --if-present
3536
shell: bash
37+
- name: "build minified main css library, js plugins and demo in standalone mode"
38+
if: ${{ inputs.stage == 'release' }}
39+
env:
40+
PACKAGE_VERSION: v${{ steps.package-version.outputs.current-version }}
41+
run: |
42+
npm install
43+
npm run lint
44+
npm run build
45+
parcel build --target demo --no-source-maps --no-content-hash --public-url ./v${{ steps.package-version.outputs.current-version }}
46+
npm run test --if-present
47+
shell: bash
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build lib and demo page Action
2+
desctipion: "Build and test the lib and demo page"
3+
inputs:
4+
package_version:
5+
description: "Package version related to given stage"
6+
required: true
7+
type: string
8+
stage:
9+
description: "Current stage"
10+
default: "beta"
11+
required: false
12+
type: string
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: deploy demo app to Azure static website
17+
uses: azure/CLI@v1
18+
env:
19+
PACKAGE_VERSION: "${{ inputs.package_version }}"
20+
ACCOUNT_NAME: stevodocs
21+
DEMO_ROOT_DIR: "$web"
22+
DEMO_SOURCE_DIR: demo_build
23+
DEMO_DEST_DIR: "$web/mgplus/demo/${{ inputs.package_version }}"
24+
DIST_SOURCE_DIR: dist
25+
DIST_DEST_DIR: "mgpluscdn/${{ inputs.package_version }}"
26+
with:
27+
azcliversion: 2.30.0
28+
inlineScript: |
29+
az extension add -n storage-preview -y
30+
az storage blob upload-batch -s $DEMO_SOURCE_DIR -d $DEMO_DEST_DIR --account-name $ACCOUNT_NAME
31+
az storage blob upload-batch -s $DIST_SOURCE_DIR -d $DIST_DEST_DIR --account-name $ACCOUNT_NAME
32+
az cdn endpoint purge -g rg-devops -n mgplus-demo --profile-name cdn-evo --content-paths '/${{ inputs.package_version }}'
33+
az cdn endpoint purge -g rg-devops -n cdn-mgplus --profile-name cdn-evo2 --content-paths '/${{ inputs.package_version }}'

.github/workflows/azure-cdn-deploy.yml

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
id-token: write
2525
steps:
2626
- uses: actions/checkout@v3
27-
- name: "build lib and deploy demo"
27+
- name: "build lib and demo"
2828
id: "build_action"
2929
uses: ./.github/actions/build-action
3030
with:
@@ -36,24 +36,12 @@ jobs:
3636
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3737
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3838
enable-AzPSSession: true
39-
- name: deploy demo app to Azure static website
40-
uses: azure/CLI@v1
41-
env:
42-
PACKAGE_VERSION: "${{ steps.build_action.outputs.package_version }}"
43-
ACCOUNT_NAME: stevodocs
44-
DEMO_ROOT_DIR: "$web"
45-
DEMO_SOURCE_DIR: demo_build
46-
DEMO_DEST_DIR: "$web/mgplus/demo/${{ steps.build_action.outputs.package_version }}"
47-
DIST_SOURCE_DIR: dist
48-
DIST_DEST_DIR: "mgpluscdn/${{ steps.build_action.outputs.package_version }}"
39+
- name: "deploy lib and demo"
40+
id: "deploy_action"
41+
uses: ./.github/actions/deploy-action
4942
with:
50-
azcliversion: 2.30.0
51-
inlineScript: |
52-
az extension add -n storage-preview -y
53-
az storage blob upload-batch -s $DEMO_SOURCE_DIR -d $DEMO_DEST_DIR --account-name $ACCOUNT_NAME
54-
az storage blob upload-batch -s $DIST_SOURCE_DIR -d $DIST_DEST_DIR --account-name $ACCOUNT_NAME
55-
az cdn endpoint purge -g rg-devops -n mgplus-demo --profile-name cdn-evo --content-paths '/*'
56-
az cdn endpoint purge -g rg-devops -n cdn-mgplus --profile-name cdn-evo2 --content-paths '/*'
43+
package_version: ${{ steps.build_action.outputs.package_version }}
44+
stage: "beta-${{ github.event.pull_request.number }}"
5745
deploy_preview:
5846
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/master') == true
5947
runs-on: ubuntu-latest
@@ -63,7 +51,7 @@ jobs:
6351
id-token: write
6452
steps:
6553
- uses: actions/checkout@v3
66-
- name: "build lib and deploy demo"
54+
- name: "build lib and demo"
6755
uses: ./.github/actions/build-action
6856
id: "build_action"
6957
with:
@@ -75,20 +63,12 @@ jobs:
7563
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
7664
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
7765
enable-AzPSSession: true
78-
- name: deploy demo site to Azure static website
79-
uses: azure/CLI@v1
80-
env:
81-
ACCOUNT_NAME: stevodocs
82-
DEMO_SOURCE_DIR: demo_build
83-
DEMO_DEST_DIR: "$web/mgplus/demo/${{ steps.build_action.outputs.package_version }}"
84-
DIST_SOURCE_DIR: dist
85-
DIST_DEST_DIR: "mgpluscdn/${{ steps.build_action.outputs.package_version }}"
66+
- name: "deploy lib and demo"
67+
id: "deploy_action"
68+
uses: ./.github/actions/deploy-action
8669
with:
87-
azcliversion: 2.30.0
88-
inlineScript: |
89-
az extension add -n storage-preview -y
90-
az storage blob upload-batch -s $DEMO_SOURCE_DIR -d $DEMO_DEST_DIR --account-name $ACCOUNT_NAME
91-
az storage blob upload-batch -s $DIST_SOURCE_DIR -d $DIST_DEST_DIR --account-name $ACCOUNT_NAME
70+
package_version: ${{ steps.build_action.outputs.package_version }}
71+
stage: "preview"
9272
deploy_release:
9373
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') == true
9474
runs-on: ubuntu-latest
@@ -98,7 +78,7 @@ jobs:
9878
id-token: write
9979
steps:
10080
- uses: actions/checkout@v3
101-
- name: "build lib and deploy demo"
81+
- name: "build lib and demo"
10282
uses: ./.github/actions/build-action
10383
id: "build_action"
10484
with:
@@ -110,17 +90,9 @@ jobs:
11090
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
11191
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
11292
enable-AzPSSession: true
113-
- name: deploy demo site to Azure static website
114-
uses: azure/CLI@v1
115-
env:
116-
ACCOUNT_NAME: stevodocs
117-
DEMO_SOURCE_DIR: demo_build
118-
DEMO_DEST_DIR: "$web/mgplus/demo/${{ steps.build_action.outputs.package_base_version }}"
119-
DIST_SOURCE_DIR: dist
120-
DIST_DEST_DIR: "mgpluscdn/${{ steps.build_action.outputs.package_base_version }}"
93+
- name: "deploy lib and demo"
94+
id: "deploy_action"
95+
uses: ./.github/actions/deploy-action
12196
with:
122-
azcliversion: 2.30.0
123-
inlineScript: |
124-
az extension add -n storage-preview -y
125-
az storage blob upload-batch -s $DEMO_SOURCE_DIR -d $DEMO_DEST_DIR --account-name $ACCOUNT_NAME
126-
az storage blob upload-batch -s $DIST_SOURCE_DIR -d $DIST_DEST_DIR --account-name $ACCOUNT_NAME
97+
package_version: ${{ steps.build_action.outputs.package_base_version }}
98+
stage: "release"

.github/workflows/azure-static-web-apps-purple-glacier-0a500d203.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,7 @@ on:
66
- v[0-9]+.[0-9]+.[0-9]+*
77
branches:
88
- master
9-
paths: ["demo/**"]
10-
pull_request:
11-
types: [opened, synchronize, reopened, closed]
12-
branches:
13-
- master
14-
paths: ["demo/**"]
15-
169
jobs:
17-
build_deploy_pullrequest:
18-
if: github.event_name == 'pull_request' && github.event.action != 'closed'
19-
runs-on: ubuntu-latest
20-
name: Build and Deploy Beta
21-
steps:
22-
- uses: actions/checkout@v3
23-
with:
24-
submodules: true
25-
lfs: false
26-
- name: get-npm-version
27-
id: package-version
28-
uses: martinbeentjes/npm-get-version-action@v1.3.1
29-
- name: Build And Deploy
30-
env:
31-
PACKAGE_VERSION: v${{ steps.package-version.outputs.current-version}}-beta-${{ github.event.pull_request.number }}
32-
id: builddeploy
33-
uses: Azure/static-web-apps-deploy@v1
34-
with:
35-
deployment_environment: "Preview"
36-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PURPLE_GLACIER_0A500D203 }}
37-
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
38-
action: "upload"
39-
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
40-
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
41-
app_location: "." # App source code path
42-
api_location: "" # Api source code path - optional
43-
output_location: "./demo_build" # Built app content directory - optional
44-
app_build_command: "npm run build:demo"
45-
###### End of Repository/Build Configurations ######
46-
4710
build_deploy_rc:
4811
if: github.event_name == 'push' && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') != true
4912
runs-on: ubuntu-latest
@@ -101,15 +64,3 @@ jobs:
10164
output_location: "./demo_build" # Built app content directory - optional
10265
app_build_command: "npm run build:demo"
10366
###### End of Repository/Build Configurations ######
104-
105-
close_pull_request_job:
106-
if: github.event_name == 'pull_request' && github.event.action == 'closed'
107-
runs-on: ubuntu-latest
108-
name: Close Pull Request Job
109-
steps:
110-
- name: Close Pull Request
111-
id: closepullrequest
112-
uses: Azure/static-web-apps-deploy@v1
113-
with:
114-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PURPLE_GLACIER_0A500D203 }}
115-
action: "close"

.github/workflows/npm-publish-v2.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11+
- name: "build lib and deploy demo"
12+
uses: ./.github/actions/build-action
13+
id: "build_action"
14+
with:
15+
stage: "release"
1116
- uses: actions/setup-node@v1
1217
with:
1318
node-version: 14

changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3-
**Milligram** uses [GitHub's Releases feature](https://github.com/blog/1547-release-your-software) for its changelogs.
3+
All notable changes to this library will be documented in github releases page.
44

5-
See our [releases](https://github.com/milligram/milligram/releases) to accompany at the improvements for each version of **Milligram**.
5+
[Portal](https://www.mgpluscss.com)
6+
[Repo](https://github.com/mgpluscss/mgplus)
7+
[Releases](https://github.com/mgpluscss/mgplus/releases)

demo/index.html

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,57 +18,59 @@
1818

1919
<body>
2020
<header>
21+
2122
<nav class="mg-fixed-top mg-w-full mg-pad1 ">
22-
<div class="mg-w-full mg-row mg-x--middle mg-x--between">
23-
<div class="mg-group mg-pad-l1">
24-
<div class="mg-dropdown">
25-
<button title="theme-switcher" data-toggle="dropdown" class="mg-button--small mg-icon-dropdown">
26-
<i class="mg-icon svg-icon-darkmode"></i>
27-
</button>
28-
<div class="mg-dropdown--content">
29-
<div class="mg-nav">
30-
<ul>
31-
<li data-toggle="theme" data-value="light">Light</li>
32-
<li data-toggle="theme" data-value="dark">Dark</li>
33-
<li data-toggle="theme" data-value="auto">Auto</li>
34-
</ul>
35-
</div>
23+
<div class="mg-group mg-pad-l1">
24+
<div class="mg-dropdown">
25+
<button title="theme-switcher" data-toggle="dropdown" class="mg-button--small mg-icon-dropdown">
26+
<i class="mg-icon svg-icon-darkmode"></i>
27+
</button>
28+
<div class="mg-dropdown--content">
29+
<div class="mg-nav">
30+
<ul>
31+
<li data-toggle="theme" data-value="light">Light</li>
32+
<li data-toggle="theme" data-value="dark">Dark</li>
33+
<li data-toggle="theme" data-value="auto">Auto</li>
34+
</ul>
3635
</div>
3736
</div>
38-
<div class="mg-dropdown">
39-
<button title="controls" data-toggle="dropdown" class="mg-button--small mg-icon-dropdown">
40-
<i class="mg-icon svg-icon-gears"></i>
41-
</button>
42-
<div class="mg-dropdown--content mg-pad-r3 mg-pad-l1">
43-
<div class="mg-col mg-x--start">
44-
<label for="range2">Control radius</label>
45-
<input type="range" min="0" max="20" value="2" id="control-radius-selector" />
46-
<label for="range1">Input radius</label>
47-
<input type="range" min="0" max="20" value="2" id="input-radius-selector" />
48-
</div>
37+
</div>
38+
<div class="mg-dropdown">
39+
<button title="controls" data-toggle="dropdown" class="mg-button--small mg-icon-dropdown">
40+
<i class="mg-icon svg-icon-gears"></i>
41+
</button>
42+
<div class="mg-dropdown--content mg-pad-r3 mg-pad-l1">
43+
<div class="mg-col mg-x--start">
44+
<label for="range2">Control radius</label>
45+
<input type="range" min="0" max="20" value="2" id="control-radius-selector" />
46+
<label for="range1">Input radius</label>
47+
<input type="range" min="0" max="20" value="2" id="input-radius-selector" />
4948
</div>
5049
</div>
51-
<div class="mg-dropdown">
52-
<button title="color-picker" data-toggle="dropdown" class="mg-button--small mg-icon-dropdown">
53-
<i class="mg-icon svg-icon-colors"></i>
54-
</button>
55-
<div class="mg-dropdown--content">
56-
<div class="mg-row">
57-
<div id="picker"></div>
58-
</div>
50+
</div>
51+
<div class="mg-dropdown">
52+
<button title="color-picker" data-toggle="dropdown" class="mg-button--small mg-icon-dropdown">
53+
<i class="mg-icon svg-icon-colors"></i>
54+
</button>
55+
<div class="mg-dropdown--content">
56+
<div class="mg-row">
57+
<div id="picker"></div>
5958
</div>
6059
</div>
6160
</div>
62-
<div class="mg-right mg-dropdown mg-xl-display">
63-
<button title="menu" data-toggle="dropdown" class="mg-rounded-full mg-h5 mg-w5">
64-
<i class="mg-icon mg-icon--3xl icon-menu"></i>
65-
</button>
66-
<div class="mg-dropdown--content mg-right mg-nav mg-w50vh mg-max-h80vh">
67-
<ul class="mg-text-l mg-text-bold" data-toggle="navlinks">
61+
</div>
62+
<div class="mg-right mg-dropdown mg-xl-display">
63+
<button title="menu" data-toggle="dropdown" class="mg-rounded-full mg-h5 mg-w5">
64+
<i class="mg-icon mg-icon--3xl icon-menu"></i>
65+
</button>
66+
<div class="mg-dropdown--content mg-right">
67+
<div class="mg-nav">
68+
<ul data-toggle="navlinks" class="mg-text-bold">
6869
</ul>
6970
</div>
7071
</div>
7172
</div>
73+
7274
</nav>
7375
<img alt="logo" class="logo-animation" src="./images/logo.svg" height="120" />
7476
<div class="mg-light">
@@ -102,11 +104,12 @@ <h2>A micro CSS library </h2>
102104
</svg>
103105

104106
</header>
107+
105108
<div
106-
class="mg-fixed mg-top5 mg-right mg-bg-initial mg-rounded mg-border-thin mg-marg1 mg-pad-r1 mg-pad-l1 mg-xl-hidden">
107-
<div class=" mg-max-h90vh mg-overflow-y-auto">
109+
class="mg-fixed mg-top5 mg-right mg-bg-initial mg-rounded mg-border-thin mg-marg-l1 mg-marg-r1 mg-pad1 mg-xl-hidden">
110+
<div class=" mg-max-h80vh mg-overflow-y-auto">
108111
<div class="mg-nav">
109-
<ul data-toggle="navlinks">
112+
<ul data-toggle="navlinks" class="mg-text-bold">
110113
</ul>
111114
</div>
112115
</div>

demo/sections/helpers-section.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ <h3>Visibility</h3>
9393
<span><code>.mg-rounded-tr[0-10]</code> { border-top-right-radius: [0-10]rem;}</span>
9494
<span><code>.mg-rounded-br[0-10]</code> { border-bottom-right-radius: [0-10]rem;}</span>
9595
<span><code>.mg-rounded-bl[0-10]</code> { border-bottom-left-radius: [0-10]rem;}</span>
96-
9796
<span><code>.mg-rounded-none</code> { border-radius: 0;}</span>
9897
<span><code>.mg-rounded-full</code> { border-radius: 100%;}</span>
98+
<h4>z-index (0 to 500 step 100)</h4>
99+
<span><code>.mg-z[0-5]</code> { z-index: [0-500];}</span>
100+
<span><code>.mg-z-full</code> { z-index: 999;}</span>
99101

100102
</div>
101103

dist/css/mgplus.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"name": "mgplus",
4-
"version": "1.3.3",
4+
"version": "1.3.4",
55
"description": "mgplus a micro CSS library",
66
"homepage": "https://evodim.github.io/mgplus",
77
"repository": "https://github.com/Evodim/mgplus",

0 commit comments

Comments
 (0)