Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Prettier for code formatting and implement Sass #11

Open
wnm210 opened this issue Jun 29, 2023 · 4 comments
Open

Use Prettier for code formatting and implement Sass #11

wnm210 opened this issue Jun 29, 2023 · 4 comments

Comments

@wnm210
Copy link

wnm210 commented Jun 29, 2023

I propose implementing Sass and Prettier to this project. It would make things easier. Prettier is a code formatter, read more about it here. Sass is a stylesheet language that is compiled to CSS. It is really easy to use and saves you a lot of time when writing styling rules. Documentation: https://sass-lang.com/documentation/

Prettier is a great tool and it supports plenty of languages. You should also implement it to your other projects as the key feature of it is that there is no need to discuss style in code review.

Prettier configuration that I use

{
    "tabWidth": 4,
    "useTabs": false,
    "printWidth": 180,
    "singleQuote": true,
    "bracketSpacing": true,
    "bracketSameLine": true
}

Sass syntax

@mixin button-base()
    @include typography(button)
    @include ripple-surface
    @include ripple-radius-bounded

    display: inline-flex
    position: relative
    height: $button-height
    border: none
    vertical-align: middle

    &:hover
        cursor: pointer

    &:disabled
        color: $mdc-button-disabled-ink-color
        cursor: default
        pointer-events: none
@GeopJr
Copy link
Collaborator

GeopJr commented Jun 29, 2023

Thanks for bringing this up!

The decision when first writing this was to avoid any build steps and js as much as possible. Introducing sass and prettier (for ~400 lines of css and ~100 lines of js) is a bit too-much.

I'll leave this issue open for now but it's not planned.

@wnm210
Copy link
Author

wnm210 commented Jun 30, 2023

Well, by introducing Prettier you actually don't have to run any additional compiling. You can just simply install the extension from e.g. Visual Studio marketplace and add config file to your project.

@Yimura
Copy link
Member

Yimura commented Jul 7, 2023

This would be overkill to implement for a single pager with no dynamic content so to speak off.

Maybe in the future if we were to go beyond this however I don't see this happening any time soon.

@wnm210
Copy link
Author

wnm210 commented Jul 12, 2023

Sure. By the way @Yimura what do you think of implementing Prettier to the main repo. It would be easier to keep code style. You could also think of implementing commit lint so people can only add commits that meet the rules of e.g. Conventional Commits (fix:, feat:, chore:, e.t.c.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants