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

Suggestion: Pass settings in initialization instead of using a separate builder package #47

Closed
mokhosh opened this issue Oct 6, 2019 · 4 comments

Comments

@mokhosh
Copy link

mokhosh commented Oct 6, 2019

Hey Amir, thanks for the great library.

Why don't you pass settings at initialization time and let webpack do the build process instead of building framevuerk? Something like this:

import Framevuerk from 'framevuerk/dist/framevuerk.js'

Vue.use(new Framevuerk({
    "config-name": "foobar",
    "direction": "ltr",
    "primary-color": "#41b883",
    "secondary-color": "#35485d",
    "danger-color": "#dd4b39",
    "warning-color": "#ef8f00",
    "info-color": "#14b0cf",
    "bg-color": "#fff",
    "header-bg-color": "#35485d",
    "sidebar-bg-color": "#3a3a3a",
    "footer-bg-color": "#3a3a3a",
    "padding : "1em",
    "transition-speed": "0.35s",
    "border-radius": "2px",
    "shadow-size": "1px"
}))

This will make customization and hot reloading much easier.

@nainemom
Copy link
Member

nainemom commented Oct 9, 2019

Hey. Your welcome.
The idea behind this framework was: "Building BEFORE Runtime.".
Implementing this style of configuration is much easier than what I already did, but the problem is that the Browser should apply these custom styles and variables and calculations during runtime. So heavy!

framevuerk-builder package does all the jobs before starting a project to create two pure .css and .js files. So the browser just sees builded bundles and no need to do custom configuration jobs.

@mokhosh
Copy link
Author

mokhosh commented Oct 9, 2019

I don't think it's as heavy as you think. Most popular frameworks let browser do the work instead of the developer ;)

@nainemom
Copy link
Member

nainemom commented Oct 9, 2019

I don't think that this is true words:
Most popular frameworks let browser do the work instead of the developer ;)
You don't build framevuerk bundle, framevuerk-builder does. Style of configuration passing is the only difference.

But about current configuration style:
Doing current calculations without CSS variables: yes it's heavy. think about 20 buttons inside a single page. 20 CSS style applying by Javascript!

But via CSS variables a lot of these calculations will leave, Javascript will set base CSS variables at the start of runtime. But still, there are some things:

  • Generating colors based on another (CSS don't have custom functions yet)
  • Dynamic direction positions (CSS don't have block-start: 10px; instead of left: 10px; yet)
  • Older browsers support

@mokhosh
Copy link
Author

mokhosh commented Oct 9, 2019

I'm gonna go ahead and close this. But I would suggest you at least make it part of the same build process, and not a separate package for customizing colors and styles.

@mokhosh mokhosh closed this as completed Oct 9, 2019
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

2 participants