Based on svelma project extension and modification.Bulma components for Svelte.
Go to file
KeiferJu a9407b257d 更新帮助文档 2020-05-13 13:05:08 +08:00
docs 更新帮助文档 2020-05-13 13:05:08 +08:00
public 代码上传 2020-03-21 17:35:30 +08:00
src 修改组件样式,修复跑马灯页标不显示bug 2020-05-13 13:01:50 +08:00
.gitattributes 代码上传 2020-03-21 17:35:30 +08:00
.gitignore 调整 2020-05-07 09:32:52 +08:00
.npmignore 代码上传 2020-03-21 17:35:30 +08:00
.prettierrc.js 代码上传 2020-03-21 17:35:30 +08:00
.travis.yml 代码上传 2020-03-21 17:35:30 +08:00
LICENSE 代码上传 2020-03-21 17:35:30 +08:00
README.md 更新帮助文档 2020-05-13 13:05:08 +08:00
README_en.md 更新帮助文档 2020-05-13 13:05:08 +08:00
package-lock.json 添加跑马灯组件 2020-05-07 13:56:31 +08:00
package.json 修改组件样式,修复跑马灯页标不显示bug 2020-05-13 13:01:50 +08:00
rollup.config.js 代码上传 2020-03-21 17:35:30 +08:00

README_en.md

svelma-pro

Based on svelma project extension and modification, thanks to the original author components such as c0bra and bulma Based on the original component library, some common components and bug fixes are extended, and the functions of some components are modified.

Documentation

See docs + demos site here

Quick Start

1. Create a svelte app(or sapper app) from the template

https://github.com/sveltejs/template is a template repo for svelte. degit will scaffold the repo for you:

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

2. Install svelma and dependencies

bulma and svelma-pro

$ npm install --save bulma svelma-pro

scss

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

3. config

Add the scss plugin to your rollup(webpack) config:

// 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.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. Import Bulma's CSS and Svelma components


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

5. Include Font Awesome icons

From CDN in your HTML page:

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

...or as an npm package imported into your root component:

$ 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>