@_linked/server 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +20 -0
- package/.changeset/config.json +14 -0
- package/.github/workflows/changeset-check.yml +44 -0
- package/.github/workflows/ci.yml +30 -0
- package/.github/workflows/publish.yml +42 -0
- package/CHANGELOG.md +7 -0
- package/package.json +106 -0
- package/readme.md +205 -0
- package/styles/apply-css-variables.css +10 -0
- package/styles/css-variables.css +56 -0
- package/styles/variables.css +54 -0
- package/tsconfig-cjs.json +8 -0
- package/tsconfig-esm.json +9 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
This package uses [changesets](https://github.com/changesets/changesets) for version management and publishing.
|
|
4
|
+
|
|
5
|
+
## Adding a changeset
|
|
6
|
+
|
|
7
|
+
When making a change that should trigger a new release, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx changeset
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This generates a markdown file in `.changeset/` describing the change. Commit it with your PR.
|
|
14
|
+
|
|
15
|
+
On merge to `main`, the publish workflow either:
|
|
16
|
+
|
|
17
|
+
1. Creates (or updates) a **Release PR** that bumps the version + updates `CHANGELOG.md`, or
|
|
18
|
+
2. If the Release PR is already merged, publishes the new version to npm.
|
|
19
|
+
|
|
20
|
+
Changes that don't need a release (docs, CI config, tooling) can skip the changeset — the check is a warning, not a block.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
|
|
3
|
+
"changelog": [
|
|
4
|
+
"@changesets/changelog-github",
|
|
5
|
+
{ "repo": "linked-cm/server" }
|
|
6
|
+
],
|
|
7
|
+
"commit": false,
|
|
8
|
+
"fixed": [],
|
|
9
|
+
"linked": [],
|
|
10
|
+
"access": "public",
|
|
11
|
+
"baseBranch": "main",
|
|
12
|
+
"updateInternalDependencies": "patch",
|
|
13
|
+
"ignore": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Changeset Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
changeset-check:
|
|
10
|
+
name: Check for changeset
|
|
11
|
+
# Skip the check on the automated Release PR.
|
|
12
|
+
if: ${{ github.head_ref != 'changeset-release/main' }}
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Check for changeset files
|
|
21
|
+
uses: actions/github-script@v7
|
|
22
|
+
with:
|
|
23
|
+
script: |
|
|
24
|
+
const { data: files } = await github.rest.pulls.listFiles({
|
|
25
|
+
owner: context.repo.owner,
|
|
26
|
+
repo: context.repo.repo,
|
|
27
|
+
pull_number: context.issue.number,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const hasChangeset = files.some(f =>
|
|
31
|
+
f.filename.startsWith('.changeset/') &&
|
|
32
|
+
f.filename.endsWith('.md') &&
|
|
33
|
+
f.filename !== '.changeset/README.md'
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (!hasChangeset) {
|
|
37
|
+
await github.rest.issues.createComment({
|
|
38
|
+
owner: context.repo.owner,
|
|
39
|
+
repo: context.repo.repo,
|
|
40
|
+
issue_number: context.issue.number,
|
|
41
|
+
body: "No changeset found. If this PR should trigger a release, run `npx changeset` and commit the generated file.\n\nIf this change doesn't need a release (docs, CI config, etc.), you can ignore this message."
|
|
42
|
+
});
|
|
43
|
+
core.warning('No changeset file found in this PR.');
|
|
44
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-test:
|
|
10
|
+
name: Build & Test
|
|
11
|
+
# Skip CI on the automated Release PR created by changesets/action.
|
|
12
|
+
if: ${{ !(github.event.pull_request.base.ref == 'main' && github.head_ref == 'changeset-release/main') }}
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 22.16.0
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm ci --legacy-peer-deps
|
|
25
|
+
|
|
26
|
+
- name: Build
|
|
27
|
+
run: npm run build
|
|
28
|
+
|
|
29
|
+
- name: Test
|
|
30
|
+
run: npm test --if-present
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
name: Publish Release
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 22.16.0
|
|
25
|
+
registry-url: 'https://registry.npmjs.org'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: npm ci --legacy-peer-deps
|
|
29
|
+
|
|
30
|
+
- name: Build
|
|
31
|
+
run: npm run build
|
|
32
|
+
|
|
33
|
+
- name: Create release Pull Request or Publish
|
|
34
|
+
uses: changesets/action@v1
|
|
35
|
+
with:
|
|
36
|
+
publish: npx changeset publish
|
|
37
|
+
title: 'chore: release'
|
|
38
|
+
commit: 'chore: release'
|
|
39
|
+
env:
|
|
40
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
42
|
+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
package/CHANGELOG.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@_linked/server",
|
|
3
|
+
"description": "HTTP server & utilities for LINCD applications, running on node.js.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "René Verheij",
|
|
6
|
+
"url": "https://github.com/flyon",
|
|
7
|
+
"email": "rpwverheij@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": ""
|
|
12
|
+
},
|
|
13
|
+
"version": "1.0.8",
|
|
14
|
+
"linkedPackage": true,
|
|
15
|
+
"main": "lib/cjs/index.js",
|
|
16
|
+
"types": "dist/lincd-server.d.ts",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"start": "npm exec linked dev",
|
|
20
|
+
"build": "yarn linked build",
|
|
21
|
+
"prepublishOnly": "yarn linked build production",
|
|
22
|
+
"postpublish": "npm exec linked register"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"lincd",
|
|
26
|
+
"server",
|
|
27
|
+
"nodejs",
|
|
28
|
+
"express",
|
|
29
|
+
"linked data",
|
|
30
|
+
"interoperable",
|
|
31
|
+
"semantic web",
|
|
32
|
+
"web3"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@_linked/cli": "^1.2",
|
|
36
|
+
"@_linked/core": "^2.2.1",
|
|
37
|
+
"@_linked/server-utils": "~1.0",
|
|
38
|
+
"adm-zip": "^0.5.16",
|
|
39
|
+
"archiver": "^7.0.1",
|
|
40
|
+
"autoprefixer": "^10.4.18",
|
|
41
|
+
"body-parser": "^1.20.2",
|
|
42
|
+
"chalk": "4.1.2",
|
|
43
|
+
"compression": "^1.7.4",
|
|
44
|
+
"cors": "^2.8.5",
|
|
45
|
+
"cron": "^4.3.4",
|
|
46
|
+
"express": "^4.18.3",
|
|
47
|
+
"fetch-cookie": "^3.1.0",
|
|
48
|
+
"is-object": "^1.0.2",
|
|
49
|
+
"lincd-sioc": "~1.0",
|
|
50
|
+
"n3": "^1.17.2",
|
|
51
|
+
"node-addon-api": "^8.2.2",
|
|
52
|
+
"node-hook": "^1.0.0",
|
|
53
|
+
"open": "^8.4.0",
|
|
54
|
+
"proper-lockfile": "^4.1.2",
|
|
55
|
+
"react": "^18.2",
|
|
56
|
+
"react-dom": "^18.2",
|
|
57
|
+
"react-error-boundary": "^4.0.13",
|
|
58
|
+
"react-router-dom": "^6.22.3",
|
|
59
|
+
"rimraf": "^5.0.5",
|
|
60
|
+
"sharp": "^0.34.4",
|
|
61
|
+
"tough-cookie": "^6.0.0",
|
|
62
|
+
"tsconfig-to-dual-package": "^1.2.0",
|
|
63
|
+
"typescript": "^5.7.3",
|
|
64
|
+
"webpack": "^5.90.3",
|
|
65
|
+
"webpack-dev-middleware": "^7.0.0",
|
|
66
|
+
"webpack-hot-middleware": "^2.26.1",
|
|
67
|
+
"zip-a-folder": "^3.1.8"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@types/node": "^20.12.7",
|
|
71
|
+
"@types/react-dom": "^18.0.6",
|
|
72
|
+
"cross-env": "^7.0.3",
|
|
73
|
+
"prettier": "3.2.5",
|
|
74
|
+
"typescript-plugin-css-modules": "^5.1.0",
|
|
75
|
+
"@changesets/cli": "^2.29.8",
|
|
76
|
+
"@changesets/changelog-github": "^0.5.2"
|
|
77
|
+
},
|
|
78
|
+
"module": "lib/esm/index.js",
|
|
79
|
+
"exports": {
|
|
80
|
+
".": {
|
|
81
|
+
"types": "./lib/esm/index.d.ts",
|
|
82
|
+
"import": "./lib/esm/index.js",
|
|
83
|
+
"require": "./lib/cjs/index.js"
|
|
84
|
+
},
|
|
85
|
+
"./*.js": {
|
|
86
|
+
"types": "./lib/esm/*.d.ts",
|
|
87
|
+
"import": "./lib/esm/*.js",
|
|
88
|
+
"require": "./lib/cjs/*.js"
|
|
89
|
+
},
|
|
90
|
+
"./*": {
|
|
91
|
+
"types": "./lib/esm/*.d.ts",
|
|
92
|
+
"import": "./lib/esm/*.js",
|
|
93
|
+
"require": "./lib/cjs/*.js"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"typesVersions": {
|
|
97
|
+
"*": {
|
|
98
|
+
"*": [
|
|
99
|
+
"lib/esm/*"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"publishConfig": {
|
|
104
|
+
"access": "public"
|
|
105
|
+
}
|
|
106
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# LINCD Server
|
|
2
|
+
|
|
3
|
+
This package provides a `LincdServer` which can be used to instantiate a LINCD backend environment on node.js.
|
|
4
|
+
|
|
5
|
+
If you use `npx lincd-cli create-app [name]` it will already set everything up for you to use `LincdServer`.
|
|
6
|
+
To see how it's used, open `your-site/backend/server.js`.
|
|
7
|
+
|
|
8
|
+
If you require any additional features, feel free to make a request at the LINCD Discord server.
|
|
9
|
+
If you want to further adjust the functionality of LincdServer yourself, either extend it or clone this repo locally.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
- [Environment Variables](#environment-variables)
|
|
16
|
+
- [Calling methods on the backend](#calling-methods-on-the-backend)
|
|
17
|
+
- [Shape providers](#shape-providers)
|
|
18
|
+
- [Generic backend providers](#generic-backend-providers)
|
|
19
|
+
- [Gotchas](#gotchas)
|
|
20
|
+
- [Shapes](#shapes)
|
|
21
|
+
- [LocalFileStore](#localfilestore)
|
|
22
|
+
- [TODO](#todo)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Environment Variables
|
|
27
|
+
|
|
28
|
+
```properties
|
|
29
|
+
# The port on which the server will listen
|
|
30
|
+
PORT=3000
|
|
31
|
+
|
|
32
|
+
# A descriptive URI for where the app's data can live
|
|
33
|
+
DATA_ROOT=https://app.my-site.com/data
|
|
34
|
+
|
|
35
|
+
# The site's URL - will also be used for LocalFileStore
|
|
36
|
+
SITE_ROOT=http://localhost:3000 # or https://app.my-site.com
|
|
37
|
+
|
|
38
|
+
# "development" or "production"
|
|
39
|
+
NODE_ENV=development
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Calling methods on the backend
|
|
43
|
+
|
|
44
|
+
When you use LincdServer, you can also implement backend methods that you can access from the frontend.
|
|
45
|
+
|
|
46
|
+
There is two ways to do this:
|
|
47
|
+
|
|
48
|
+
### Shape providers
|
|
49
|
+
|
|
50
|
+
With Shape providers you can connect shapes to a backend method.
|
|
51
|
+
|
|
52
|
+
Let's say for example you want to send an email to a specific person from the server.
|
|
53
|
+
You could do that from a Person shape like so:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { linkedShape } from '../package';
|
|
57
|
+
import { Shape } from '@_linked/core/lib/shapes/Shape';
|
|
58
|
+
import { Server } from 'lincd-server/lib/utils/Server';
|
|
59
|
+
|
|
60
|
+
@linkedShape
|
|
61
|
+
export class Person extends Shape {
|
|
62
|
+
sendEmail(subject: string, message: string): Promise<boolean> {
|
|
63
|
+
return Server.call(this, 'sendEmail', subject, message);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Note that `Server.call()` first takes the instance of the shape, then the method name and than any number of arguments
|
|
69
|
+
to be passed on.
|
|
70
|
+
|
|
71
|
+
To implement the backend, create `src/shapes/PersonProvider.ts`:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import Person from './Person';
|
|
75
|
+
import { ShapeProvider } from 'lincd-server-utils/lib/utils/ShapeProvider';
|
|
76
|
+
|
|
77
|
+
export class PersonProvider extends ShapeProvider {
|
|
78
|
+
static shape = Person;
|
|
79
|
+
|
|
80
|
+
static sendEmail(person: Person, subject: string, message: string): boolean {
|
|
81
|
+
//send email to person
|
|
82
|
+
//mail(person.mailbox,subject,message);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Here, PersonProvider first of all registers itself as a provider of the `Person` shape with `static shape = Person`.
|
|
88
|
+
|
|
89
|
+
Then it implements the method (sendEmail()) as a a _static_ method, which receives an instance of the shape it is
|
|
90
|
+
connected to as its first argument.
|
|
91
|
+
|
|
92
|
+
To make sure the provider is _compiled_ but _not bundled_ you need to add it to `tsconfig`.
|
|
93
|
+
|
|
94
|
+
The recommended way to do that is with a providers index file `src/providers.ts`.
|
|
95
|
+
This file will re-export all providers of your package:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
//src/providers.ts
|
|
99
|
+
export * from './shapes/PersonProvider';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Finally, add `providers.ts` to your `src/tsconfig.json`:
|
|
103
|
+
|
|
104
|
+
```json5
|
|
105
|
+
//tsconfig.json
|
|
106
|
+
{
|
|
107
|
+
//...
|
|
108
|
+
files: ['./src/index.ts', './src/providers.ts'],
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
That's all that's required to connect your frontend shapes to backend code.
|
|
113
|
+
|
|
114
|
+
### Generic backend providers
|
|
115
|
+
|
|
116
|
+
Sometimes you want to exchange data with the backend without any specific shape being involved.
|
|
117
|
+
|
|
118
|
+
For such generic backend methods, you can use generic backend providers:
|
|
119
|
+
|
|
120
|
+
Add a src/backend.ts file and include it in tsconfig.json:
|
|
121
|
+
|
|
122
|
+
```json5
|
|
123
|
+
//tsconfig.json
|
|
124
|
+
{
|
|
125
|
+
//...
|
|
126
|
+
files: ['./src/index.ts', './src/backend.ts'],
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
In `backend.ts`, export a default class that implements `IBackendProvider`.
|
|
131
|
+
In this class you can implement methods, which you can then call from the frontend.
|
|
132
|
+
|
|
133
|
+
For example:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
//src/backend.ts
|
|
137
|
+
import { IBackendProvider } from 'lincd-server/lib/interfaces/IBackendProvider';
|
|
138
|
+
|
|
139
|
+
export default class MyPackageBackendProvider implements IBackendProvider {
|
|
140
|
+
login(email: string, password: string) {
|
|
141
|
+
//do login
|
|
142
|
+
return Promise.resolve(user);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
With this example you could call the login method from the frontend like so:
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
import { packageName } from '../package';
|
|
151
|
+
import { Server } from 'lincd-server/lib/utils/Server';
|
|
152
|
+
|
|
153
|
+
Server.call(packageName, 'login', email, password).then((user) => {
|
|
154
|
+
//...
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Note that you can have **only one** generic backend provider per package.
|
|
159
|
+
|
|
160
|
+
### Gotchas
|
|
161
|
+
|
|
162
|
+
**The packageName you pass to Server.call() must match with the package that contains the provider.**
|
|
163
|
+
|
|
164
|
+
If you get a warning on the backend saying
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
Generic provider [providerName] of [packageName] does not have a method called [methodName]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
then make sure that the `packageName` you pass to `Server.call(packageName)` is imported from _the same package_ as
|
|
171
|
+
where the provider lives. Generally, this means you call `Server.call` from a component in the same package as the
|
|
172
|
+
Provider (and import packageName from `src/package.ts`). If you want to call a method from another package, then import
|
|
173
|
+
packageName from that package, or manually type it.
|
|
174
|
+
|
|
175
|
+
## Shapes
|
|
176
|
+
|
|
177
|
+
This section will be a brief overview of the shapes that are included in this package, along with example usage of each
|
|
178
|
+
shape.
|
|
179
|
+
|
|
180
|
+
### LocalFileStore
|
|
181
|
+
|
|
182
|
+
This is the default file store for LINCD. It is a simple file store that stores files in a local directory. Its usage
|
|
183
|
+
follows the general pattern of other file stores in LINCD:
|
|
184
|
+
|
|
185
|
+
- Define all storage locations when the server or application starts up
|
|
186
|
+
- Access methods of the file store through the `LinkedFileStorage` class
|
|
187
|
+
- e.g. `LinkedFileStorage.saveFile("path/to/save-file.as", fileBuffer)`
|
|
188
|
+
|
|
189
|
+
It's important to note that this file store is not suitable for frontend usage - it's intended to be used in an
|
|
190
|
+
environment that has access to the [`fs` module](https://nodejs.org/api/fs.html).
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import { LinkedFileStorage } from '@_linked/core/lib/utils/LinkedFileStorage';
|
|
194
|
+
import { LocalFileStore } from 'lincd-server/lib/shapes/LocalFileStore';
|
|
195
|
+
import path from 'path';
|
|
196
|
+
|
|
197
|
+
const pathToStore = path.join(process.cwd(), 'my-file-store');
|
|
198
|
+
const store = new LocalFileStore('my-file-store', pathToStore);
|
|
199
|
+
LinkedFileStorage.setDefaultStore(store);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## TODO
|
|
203
|
+
|
|
204
|
+
- [ ] Add tests
|
|
205
|
+
- [ ] Refactor `NodeFileStore` to `LocalQuadStore` as to not confuse FileStores with QuadStores
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
|
|
3
|
+
/*css variable*/
|
|
4
|
+
:root {
|
|
5
|
+
--font-color: #{meta.inspect($fontColor)};
|
|
6
|
+
--primary-color: #{meta.inspect($primaryColor)};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/*we COULD overwrite the variables after setting them, if we wanted to avoid people from using the SCSS variables instead of the CSS variables*/
|
|
10
|
+
/*$fontColor: null;*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*initiate sass variables (they will later be converted to CSS variables in apply-css-variables.scss)*/
|
|
2
|
+
:root {
|
|
3
|
+
--fontColor: #333333;
|
|
4
|
+
--primaryColor: #00bfff;
|
|
5
|
+
--onPrimaryColor: #ffffff;
|
|
6
|
+
--primaryContainer: lighten($primaryColor, 40%);
|
|
7
|
+
--onPrimaryContainer: #333333;
|
|
8
|
+
--secondaryColor: #67fcd4;
|
|
9
|
+
--onSecondaryColor: #ffffff;
|
|
10
|
+
--errorColor: #ff0000;
|
|
11
|
+
--warningColor: #ffa500;
|
|
12
|
+
--infoColor: #0000ff;
|
|
13
|
+
--successColor: #008000;
|
|
14
|
+
--backgroundColor: #ffffff;
|
|
15
|
+
--grayColor: #cccccc;
|
|
16
|
+
--fontFamily: 'Roboto', sans-serif;
|
|
17
|
+
--fontSize: 1rem;
|
|
18
|
+
--lineHeight: 1.5;
|
|
19
|
+
--borderRadius: 0.25rem;
|
|
20
|
+
--borderWidth: 1px;
|
|
21
|
+
--borderColor: #cccccc;
|
|
22
|
+
--borderStyle: solid;
|
|
23
|
+
--boxShadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
|
|
24
|
+
--boxShadowHover: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px 0 rgba(0, 0, 0, 0.2);
|
|
25
|
+
--boxShadowActive: 0 0 0 1px rgba(0, 0, 0, 0.1),
|
|
26
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.1);
|
|
27
|
+
--boxShadowFocus: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
|
|
28
|
+
--boxShadowError: 0 0 0 1px rgba(255, 0, 0, 0.1),
|
|
29
|
+
0 1px 2px 0 rgba(255, 0, 0, 0.1);
|
|
30
|
+
--boxShadowWarning: 0 0 0 1px rgba(255, 165, 0, 0.1),
|
|
31
|
+
0 1px 2px 0 rgba(255, 165, 0, 0.1);
|
|
32
|
+
--boxShadowInfo: 0 0 0 1px rgba(0, 0, 255, 0.1),
|
|
33
|
+
0 1px 2px 0 rgba(0, 0, 255, 0.1);
|
|
34
|
+
--boxShadowSuccess: 0 0 0 1px rgba(0, 128, 0, 0.1),
|
|
35
|
+
0 1px 2px 0 rgba(0, 128, 0, 0.1);
|
|
36
|
+
--boxShadowGray: 0 0 0 1px rgba(204, 204, 204, 0.1),
|
|
37
|
+
0 1px 2px 0 rgba(204, 204, 204, 0.1);
|
|
38
|
+
--boxShadowBackground: 0 0 0 1px rgba(255, 255, 255, 0.1),
|
|
39
|
+
0 1px 2px 0 rgba(255, 255, 255, 0.1);
|
|
40
|
+
--boxShadowText: 0 0 0 1px rgba(51, 51, 51, 0.1),
|
|
41
|
+
0 1px 2px 0 rgba(51, 51, 51, 0.1);
|
|
42
|
+
--boxShadowPrimary: 0 0 0 1px rgba(0, 191, 255, 0.1),
|
|
43
|
+
0 1px 2px 0 rgba(0, 191, 255, 0.1);
|
|
44
|
+
--boxShadowSecondary: 0 0 0 1px rgba(103, 252, 212, 0.1),
|
|
45
|
+
0 1px 2px 0 rgba(103, 252, 212, 0.1);
|
|
46
|
+
|
|
47
|
+
/*error*/
|
|
48
|
+
/*warning*/
|
|
49
|
+
/*info*/
|
|
50
|
+
/*success*/
|
|
51
|
+
//
|
|
52
|
+
/*text*/
|
|
53
|
+
/*background*/
|
|
54
|
+
/*gray*/
|
|
55
|
+
//
|
|
56
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*initiate sass variables (they will later be converted to CSS variables in apply-css-variables.scss)*/
|
|
2
|
+
$fontColor: #333333;
|
|
3
|
+
$primaryColor: #00bfff;
|
|
4
|
+
$onPrimaryColor: #ffffff;
|
|
5
|
+
$primaryContainer: lighten($primaryColor, 40%);
|
|
6
|
+
$onPrimaryContainer: #333333;
|
|
7
|
+
|
|
8
|
+
$secondaryColor: #67fcd4;
|
|
9
|
+
$onSecondaryColor: #ffffff;
|
|
10
|
+
|
|
11
|
+
$errorColor: #ff0000;
|
|
12
|
+
$warningColor: #ffa500;
|
|
13
|
+
$infoColor: #0000ff;
|
|
14
|
+
$successColor: #008000;
|
|
15
|
+
$backgroundColor: #ffffff;
|
|
16
|
+
$grayColor: #cccccc;
|
|
17
|
+
$fontFamily: 'Roboto', sans-serif;
|
|
18
|
+
$fontSize: 1rem;
|
|
19
|
+
$lineHeight: 1.5;
|
|
20
|
+
$borderRadius: 0.25rem;
|
|
21
|
+
$borderWidth: 1px;
|
|
22
|
+
$borderColor: #cccccc;
|
|
23
|
+
$borderStyle: solid;
|
|
24
|
+
$boxShadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
|
|
25
|
+
$boxShadowHover: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px 0 rgba(0, 0, 0, 0.2);
|
|
26
|
+
$boxShadowActive: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
|
|
27
|
+
$boxShadowFocus: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
|
|
28
|
+
$boxShadowError: 0 0 0 1px rgba(255, 0, 0, 0.1),
|
|
29
|
+
0 1px 2px 0 rgba(255, 0, 0, 0.1);
|
|
30
|
+
$boxShadowWarning: 0 0 0 1px rgba(255, 165, 0, 0.1),
|
|
31
|
+
0 1px 2px 0 rgba(255, 165, 0, 0.1);
|
|
32
|
+
$boxShadowInfo: 0 0 0 1px rgba(0, 0, 255, 0.1), 0 1px 2px 0 rgba(0, 0, 255, 0.1);
|
|
33
|
+
$boxShadowSuccess: 0 0 0 1px rgba(0, 128, 0, 0.1),
|
|
34
|
+
0 1px 2px 0 rgba(0, 128, 0, 0.1);
|
|
35
|
+
$boxShadowGray: 0 0 0 1px rgba(204, 204, 204, 0.1),
|
|
36
|
+
0 1px 2px 0 rgba(204, 204, 204, 0.1);
|
|
37
|
+
$boxShadowBackground: 0 0 0 1px rgba(255, 255, 255, 0.1),
|
|
38
|
+
0 1px 2px 0 rgba(255, 255, 255, 0.1);
|
|
39
|
+
$boxShadowText: 0 0 0 1px rgba(51, 51, 51, 0.1),
|
|
40
|
+
0 1px 2px 0 rgba(51, 51, 51, 0.1);
|
|
41
|
+
$boxShadowPrimary: 0 0 0 1px rgba(0, 191, 255, 0.1),
|
|
42
|
+
0 1px 2px 0 rgba(0, 191, 255, 0.1);
|
|
43
|
+
$boxShadowSecondary: 0 0 0 1px rgba(103, 252, 212, 0.1),
|
|
44
|
+
0 1px 2px 0 rgba(103, 252, 212, 0.1);
|
|
45
|
+
|
|
46
|
+
/*error*/
|
|
47
|
+
/*warning*/
|
|
48
|
+
/*info*/
|
|
49
|
+
/*success*/
|
|
50
|
+
//
|
|
51
|
+
/*text*/
|
|
52
|
+
/*background*/
|
|
53
|
+
/*gray*/
|
|
54
|
+
//
|