0.8.10 • Published 3 years ago
@appartmint/n4v v0.8.10
n4v - An accessible, responsive navbar library
Hosting
Development
Getting Started
- Install 7NodeJS and 8NPM here.
- Install 15git here or 18GitHub Desktop here.
- Clone the 16GitHub repository.
PS C:\proj> git clone https://github.com/App-Art-Mint/npm-n4v.git ./npm-n4v- Change directory into the n4v project
PS C:\proj> cd n4v- Install development dependencies.
PS C:\proj\n4v> npm install- Run the development server.
PS C:\proj\n4v> npm run serve- Visit http://localhost:42069/ in a browser.
Operations
Branching
- Branch from
origin/prod. - Name your branch either:
feature/descriptive-feature-namebugfix/descriptive-bugfix-name
- Create pull requests with
origin/devwhen it's ready for testing. - Create pull requests with
origin/prodwhen it's stable.
Publishing
- Publish from
origin/prod. - Ensure the version number has been updated in
package.json. - Set
isDevtofalseinwebpack.config.tsand save. - Build prod:
PS C:\proj\n4v> npm run build- Set
isDevtotrueinwebpack.config.tsand save. - Build dev:
PS C:\proj\n4v> npm run build- Publish to 8NPM.
PS C:\proj\n4v> npm publish- Commit the new
distfiles andpackage.json.
PS C:\proj\n4v> git add -A
PS C:\proj\n4v> git commit -m "Descriptive commit message"
PS C:\proj\n4v> git pushGuidelines
General
- File names should be lowercase (besides README, LICENSE, etc.)
SCSS
- CSS variables go in
/src/scss/css-var.scssand should be included with@use. - Global styles go in
/src/scss/global.scssand should be included with@use. - Base styles go in
/src/scss/n4v.scssand should be included with@use. - Theme styles go in
/src/scss/theme.scssand should be included with@use. - SCSS variables go in
/src/scss/var.scssand should be included with@import. - Use the variables, functions, and mixins in
/src/scss/var.scssto generate selectors and css variable references with a prefix.- To use these SCSS helpers, import the file:
@import 'var'; - Mixins:
@include css-var(height, 50px)→--n4v-height: 50px;@include css-var-ref(width, height)→--n4v-width: var(--n4v-height);
- Functions:
-
css-var(height)→var(--n4v-height)// NOTE: No string interpolation -#{neg(something)}→not(something)// NOTE: Doesn't add the prefix -#{class(open)}→.n4v-open-#{id(logo)}→#n4v-logo-#{controls(wrapper)}→[controls=n4v-wrapper]-#{expanded(true)}→[aria-expanded=true]-ms(100)→100ms-px(100)→100px-strip-unit(100px)→100
- To use these SCSS helpers, import the file:
TypeScript
- Main functionality goes in
/src/ts/n4vbar.ts. - CSS selector tools go in
/src/ts/selectors.ts. Should be similar to/src/scss/var.scss. - Variable setting tools go in
/src/ts/settings.ts. - Utility functions go in
/src/ts/util.ts. - New classes should be:
- Prefixed with 'n4v' and PascalCase after that.
E.g. n4vClassName. - Exported as default in the file that defines them.
I.e. export default n4vClassName;. - Imported and exported in
/src/main.ts.
- Prefixed with 'n4v' and PascalCase after that.
- Event functions should be:
- Prefixed with a lowercase 'e'.
E.g. eHandleEvent(). - Attached using
Function.bind(this). - Attached using the
n4vUtil.throttle()function.- The default timeout is
n4vSettings.delay.default. - The default options are
{ leading: true, trailing: true }.
- The default timeout is
- Casted
as EventListenerOrEventListenerObject.
- Prefixed with a lowercase 'e'.