Skip to content

Commit

Permalink
Merge pull request #20 from spielrs/development
Browse files Browse the repository at this point in the history
  • Loading branch information
dancespiele authored Apr 28, 2020
2 parents cfb2edb + 87d2230 commit a434a50
Show file tree
Hide file tree
Showing 43 changed files with 1,880 additions and 1,011 deletions.
5 changes: 5 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build]
target="wasm32-unknown-unknown"

[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))']
runner = 'wasm-bindgen-test-runner'
31 changes: 31 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Yew Styles

on:
pull_request:
branches: [ master, development ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: wasm-pack
uses: jetli/[email protected]
with:
version: 'latest'
- name: install rustfmt
run: rustup component add rustfmt
- name: install clippy
run: rustup component add clippy
- name: install stable
run: rustup install stable
- name: add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
- name: download geckodriver
run: curl --retry 5 -LO https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
- name: uncompress geckodriver
run: tar -xzf geckodriver-v0.26.0-linux64.tar.gz
- name: execute CI
run: GECKODRIVER=$(pwd)/geckodriver ./ci/run_checks.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ crate/pkg
crate/target
crate/wasm-pack.log
crate/yew_styles/target
crate/yew_styles/pkg
.cache
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE-MIT → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 The Rust Project Developers
Copyright (c) 2020 Francisco Jesus Navarro Cortes

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
201 changes: 0 additions & 201 deletions LICENSE-APACHE

This file was deleted.

57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
# `yewstyle`

This is an initial project of a framework style for yew

you can run the project with:

* `npm start`

To install yew-styles in your project, execute in the root path:
# Yew Styles
Yew Styles is a style framework for yew

## Motivation
The purpose of developing this project is first,
provide a style framework for yew because there isn't not many options currently,
also to create a layout system which is not far of the flexbox concept, and,
to take the rust benefits and implement a properties selected by enumeration
in the most of the cases which makes fast for developing applications and avoids the practice try and error

## How it works
Each component is splited in two parts, the logical yew component and its sass module,
however, it is not necessary to worry about the sass module only it needs to be include in the project
### How install it
1. Install the sass module: `npm install yew-styles`
2. Add the yew_style crate in Cargo.toml file: `yew_styles = "0.3.0"`
3. Import the main.css file in you main javascript/typescript file project:
```typescript
import 'node_modules/yew-styles/main.css';
```
4. Ready to import and use in your project 🚀

* `npm install yew-styles`
## Run the documentation page
1. `git clone https://github.com/spielrs/yew_styles.git`
2. `cd yew_styles`
3. `npm start`

* after import the css in your index.js/index.ts file:
In the left side there is a list of links where each one access to a correspondent component documentation,
there, shows how to use it.

```javascript
import 'node_modules/yew-styles/main.css';
```
## Run the tests
Inside of the project run:

* include in your Cargo.toml if you want to use web-sys feature this:
`cargo test --target wasm32-unknown-unknown --manifest-path=crate/yew_styles/Cargo.toml`

```toml
yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["web_sys"]}
```
## Development phase
Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application.
All contributions are appreciated.

or this if you want to use stdweb instead
## License

```toml
yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["std_web"]}
```
Yew Style is MIT licensed. See [license](LICENSE)
3 changes: 3 additions & 0 deletions app/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import './yew-styles/main.sass';
import './page-styles/main.sass';
import 'prismjs/themes/prism.css';
import 'prismjs/components/prism-rust';

import module from '../crate/Cargo.toml';
module.run();
5 changes: 4 additions & 1 deletion app/page-styles/_app.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
&:hover
background-color: rgb(230, 236, 241)


.container
.item
code
font-size: 1vw
7 changes: 7 additions & 0 deletions ci/run_checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euxo pipefail

cargo fmt --manifest-path=crate/yew_styles/Cargo.toml --all -- --check
cargo clippy --manifest-path=crate/yew_styles/Cargo.toml --all -- --deny=warnings
wasm-pack test --headless --firefox crate/yew_styles
2 changes: 2 additions & 0 deletions crate/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target="wasm32-unknown-unknown"
Loading

0 comments on commit a434a50

Please sign in to comment.