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

unparsed sass variable from fieldSwitch in vfg.css #449

Closed
1 task done
lmj0011 opened this issue Apr 27, 2018 · 3 comments
Closed
1 task done

unparsed sass variable from fieldSwitch in vfg.css #449

lmj0011 opened this issue Apr 27, 2018 · 3 comments

Comments

@lmj0011
Copy link

lmj0011 commented Apr 27, 2018

  • I'm submitting a ...
    • bug report
  • Do you want to request a feature or report a bug?
    a bug
  • What is the current behavior?

dist/vfg.css contains an unparsed variable $field-switch-height

see: https://github.com/vue-generators/vue-form-generator/blob/v2.2.2/dist/vfg.css

which means importing this stylesheet into a vue component like:

import "vue-form-generator/dist/vfg-core.css"

throws an error (in my case, I'm using vue.js via the nuxt.js framework )

NuxtServerError
Module build failed: Error: Lexical error on line 1. Unrecognized text. 100% - ($field-switch-height --------^ at Parser.parseError ...

this error also prevents the "switch" componet of a form from displaying properly, like rendered in this demo of vue-form-generator demo

  • What is the expected behavior?

expecting the css file vue-form-generator/dist/vfg-core.css to import without error, and for the Switch component to render like in the vue-form-generator demo

screenshot-jsfiddle net-2018 04 27-10-58-21

  • Please tell us about your environment:

    • Version: [2.2.2 ]
    • Browser: [all ]
    • Language: [ES6/7 | ES5]
@zoul0813
Copy link
Member

This bug appears to be present in every release version of VFG 2.x. The $field-switch-height variable is defined and is parsed properly in the rest of the SASS for the component, so I'm guessing the calc(100% - ($field-switch-height - 1px)); line is confusing the SASS compiler.

The switch component appears to work fine in the JSFiddle examples, using the v2.2.2 release so this bug appears to be a compile-time issue?

Looks like we can just remove the $field-switch-height variable from the calc call and replace it with the hard-coded value of 30px (this variable isn't configurable in the component, it's just defined for convenience).

@zoul0813 zoul0813 changed the title Unrecognized text $field-switch-height unparsed sass variable from fieldSwitch in vfg.css Apr 27, 2018
@lmj0011
Copy link
Author

lmj0011 commented Apr 28, 2018

@zoul0813

Out of curiosity, where is the source file for vue-form-generator/dist/vfg-core.css at or is coming from?

I'm unable to find it in this repo.

@zoul0813
Copy link
Member

The CSS is compiled from the various style tags of the components and merged.

This bug is the fieldSwitch.vue file

zoul0813 added a commit that referenced this issue Apr 28, 2018
closes #449 - converted `$field-switch-height` to `30px` in `calc()` call
zoul0813 added a commit to zoul0813/vue-form-generator that referenced this issue Apr 30, 2018
* master:
  closes vue-generators#449 - converted `$field-switch-height` to `30px` in `calc()` call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants