Thanks for contributing!
- Make sure the issue hasn't been raised yet
- Include screenshots or animated GIFs in your issue whenever needed (if visual issue)
- The
masterbranch is a snapshot of the latest release. Submit your PR in thedevbranch - Include screenshots or animated GIFs in your pull request whenever needed (if visual changes)
- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging
- Make sure all the unit tests pass by running
npm testboth in the library and documentation - Make sure your code style is consistent by running
npm run lint:fixboth in the libary and documentation - DO NOT commit the
libanddistfolder, use it only for testing on your end - If adding new feature:
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it
It has to work, and have great UX on both platforms.
- Keep it simple.
- Performance is UX, keep it lightweight.
- Avoid HTML-only components, if it doesn't need JavaScript, then it doesn't need Vue (with a few exceptions).
Buefy is based on Bulma, let's keep its design.
The only properties that uses hardware acceleration are:
- transform
- opacity
- filter
These are two great articles about it: https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108 and https://www.sitepoint.com/introduction-to-hardware-acceleration-css-animations/.
And here is one about the FLIP technique (which <transition-group> uses internally): https://aerotwist.com/blog/flip-your-animations/.
- Follow the ESLint rules:
npm run lint - Add comments if method is too complex and/or whenever you judge necessary.
- Always on a separated file in
/src/scss/components - Use .scss extension
- Use kebab-case
- Use only classes
- Use only double quotes
" - Use only rem or em for
padding,marginandfont-size - No trailing space
- End files with a new line
- Order the CSS rule by:
- direct styles
- nested tags
- pseudo-classes
- modifiers
- responsive styles
Sass example:
.element {
// Direct styles
@extend .something;
@include mixin;
property: value;
// Nested tags
span {
// ...
}
.child {
// ...
}
// Pseudo-classes
&:before {
// ...
}
// Modifiers
&.is-active {
// ...
}
&.has-icon {
// ...
}
// Responsive styles
@include mobile {
// ...
}
@include tablet {
// ...
}
}You need Node.js version >= 16.
After cloning the repo, run:
npm installThe core source files of Buefy are in the packages/buefy-next folder.
cd packages/buefy-nextnpm run type-checknpm testnpm run lintYou can apply the automatic fixes by running:
npm run lint:fixnpm run buildYou can find the bundled files in the dist folder.
The source files of the Buefy documentation are in the packages/docs folder.
cd packages/docsnpm run devThe documentation will be served at https://localhost:5173/.
npm run type-checknpm run lintYou can apply the automatic fixes by running:
npm run lint:fixPrerequisite: Bundling the library
npm run buildYou can preview the production build by running:
npm run previewAs some type errors may be detected only in the production build, you should also perform type checking for the production build:
npm run build:type-check