Based on svelma project extension and modification.Bulma components for Svelte.
Go to file
dependabot[bot] e67f891a2e
Bump bl from 1.2.2 to 1.2.3 in /docs
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 09:45:20 +00:00
docs Bump bl from 1.2.2 to 1.2.3 in /docs 2021-03-29 09:45:20 +00:00
public update 2.0.0 2021-03-29 13:49:55 +08:00
src update 2.0.0 2021-03-29 13:49:55 +08:00
.gitattributes update 2.0.0 2021-03-29 13:49:55 +08:00
.gitignore update 2.0.0 2021-03-29 13:49:55 +08:00
.npmignore update 2.0.0 2021-03-29 13:49:55 +08:00
.prettierrc.js update 2.0.0 2021-03-29 13:49:55 +08:00
.travis.yml update 2.0.0 2021-03-29 13:49:55 +08:00
LICENSE update 2.0.0 2021-03-29 13:49:55 +08:00
README.md update 2.0.0 2021-03-29 14:17:04 +08:00
deploy.js update 2.0.0 2021-03-29 14:17:04 +08:00
package.json update 2.0.0 2021-03-29 14:17:04 +08:00
rollup.config.js update 2.0.0 2021-03-29 13:49:55 +08:00
yarn.lock update 2.0.0 2021-03-29 14:17:04 +08:00

README.md

svelma-pro

基于开源项目svelma 扩展和修改.

原项目组件比较少,存在一些小bug,所以在原有的组件库的基础上,扩展了一些常见的组件,并对发现的一些bug进行了修改对原有的组件功能,事件以及用户配置进行更人性化的修改和扩展。

文档

文档及Demo

快速开始

1. 通过template创建svelte应用(或者sapper应用)

https://github.com/sveltejs/template 是一个svelte的初始化模板. degit这个脚手架可以帮你获取它:

$ npx degit sveltejs/template my-svelma-project
$ cd my-svelma-project
$ npm install

2. 引入bulma样式及svelma-pro组件等依赖

bulma and svelma-pro

$ npm install --save bulma svelma-pro

scss

 $ npm install --save-dev svelte-preprocess autoprefixer node-sass sass

3. config

在你的rollup或者webpack配置文件中添加scss支持:

// rollup配置  rollup.config.js
import sveltePreprocess from 'svelte-preprocess';

// ...

const preprocess = sveltePreprocess({
  scss: {
    includePaths: ['src'],
  },
  postcss: {
    plugins: [require('autoprefixer')],
  },
});

export default {
  // ... 
  plugins: [
    svelte({
      // ...
      preprocess: preprocess,
    })
  ]
}
// webpack配置  webpack.config.js
import sveltePreprocess from 'svelte-preprocess';

// ...
const preprocess = sveltePreprocess({
  scss: {
    includePaths: ['src'],
  },
  postcss: {
    plugins: [require('autoprefixer')],
  },
});

module.export = {
  // ... 
  module: {
    rules: [
      {
        test: /.(svelte|html)$/,
        use: {
          loader: 'svelte-loader',
          options: {
            preprocess, 
            // ...
          }
        }
      },
    ]
  },
  ]
}

4. 引入Bulma的CSS样式和svelma-pro组件


<!-- main.js or client.js(sapper) -->
<script>
  import 'bulma/css/bulma.css'
  import "/svelma-pro/src/svelma-pro.css";
</script>

5. 引入 Font Awesome 图标:

在你的主HTML配置CDN页面:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"></link>

...或者通过npm包:

$ npm install --save @fortawesome/fontawesome-free
 <!-- main.js or client.js(sapper) -->
<script>
  import 'bulma/css/bulma.css'
  import '@fortawesome/fontawesome-free/css/all.css'
</script>