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

Error with CSS-Variables #537

Closed
wottpal opened this issue Jul 18, 2017 · 8 comments
Closed

Error with CSS-Variables #537

wottpal opened this issue Jul 18, 2017 · 8 comments

Comments

@wottpal
Copy link

wottpal commented Jul 18, 2017

I am not pretty sure about the error. I have made a screenshot and attached the .scss-file where it occurs.

bildschirmfoto 2017-07-18 um 23 47 41

Thanks in advance,
Dennis


/**
* This is a card component for displaying text-/media-content in a grid.
**/

$cards-grid-size: 3;
$card-margin: $site-frame-width * 2 / 4;

.c-cards {
  margin: - $card-margin;
  --cards-grid-size: 3;// $cards-grid-size;

  @include media("<small") {
    --cards-grid-size: 1;
  }
  @include media(">=small","<large") {
    --cards-grid-size: 2;
  }
  @include media(">=very-large") {
    --cards-grid-size: 4;
  }
}


.c-card {
  float: left;
  width: #{100% * (1 / $cards-grid-size)};
  width: calc(100% * 1 / var(--cards-grid-size));
  padding: $card-margin;

  &--isHidden {
    display: none;
  }

  // Double Sizing of 2x2 one
  &--hasPreviewRatio2x2 {
    width: #{100% * (2 / $cards-grid-size)};
    width: calc(100% * 2 / var(--cards-grid-size));
  }

  // Hover-Effect
  filter: saturate(75%);
  transition: $base-transition;
  &:hover, &:focus {
    filter: saturate(120%);
    // transform: translate(0, -3px);
  }

  .imageset,
  img,
  video {
    background: $color-gray-ultralight;
  }
}


/* Preview-Images */

// .c-card--hasPreviewImage {
//    ...
// }


/* Preview-Videos */

// .c-card--hasPreviewVideo {
//    ...
// }


/* Different Media-Ratios for Images & Video */

.c-card--hasPreviewRatio1x1 > .c-card__media,
.c-card--hasPreviewRatio2x2 > .c-card__media {
  display: block;
  position: relative;


  &:before {
    content: '';
    display: block;
    width: 100%;
    padding-top: (1 / 1) * 100%;
  }

  > .imageset,
  > img,
  > video {
    position: absolute !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
  > video {
    width: 100%;
    height: 100%;
  }
}
.c-card--hasPreviewRatio1x1\.62 > .c-card__media:before {
  padding-top: (1.62 / 1) * 100%;
}
.c-card--hasPreviewRatio1\.62x1 > .c-card__media:before {
  padding-top: (1 / 1.62) * 100%;
}



/* Preview-Text */

.c-card__quote {
  background: $color-gray-ultralight;
  color: $color-gray-ultradark;
  @include font-monospace;
  @include font-size(13px);
  line-height: 1.6;
  padding: 1rem;
  font-style: italic;
  border-top: 3px $color-gray-light solid;

  + .c-card__info {
    border-top: 0;
    transform: translate3d(0, 0, 0);
  }
}

/* Info with Title, Summary & Tags */

.c-card__info {
  @include font-monospace();
  display: block;
  border-top: 2px white solid;
  background: $color-gray-ultradark;
  background: black;
  color: white;
  position: relative;
  padding: .8rem 1rem;
  transition: $base-transition;
  transform: translate3d(0, -1px, 0);
}

.c-card__title {
  display: block;
  color: inherit;
  text-decoration: none;
  margin-bottom: .3rem;

  &:last-child {
    margin-bottom: .1rem;
  }

  h2 {
    margin: 0;
    letter-spacing: .2px;
    @include font-size(15px);
  }

  .o-icon {
    opacity: 0;
    transform: translateX(-3px);
    transition: $base-transition;

    .c-card:hover &,
    .c-card:focus & {
      transform: translateX(0);
      opacity: 1;
    }
  }
}

.c-card__tags {
  margin: 0;
  text-overflow: ellipsis;
  width: 100%;

  ul {
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: -.25rem;
  }

  a {
    @include font-size(12px);
    text-decoration: none;
    color: $color-gray;
    margin: .25rem;
  }

  ul > li {


  }
}


@qodunpob
Copy link

qodunpob commented Aug 2, 2017

Same problem

@obenjiro obenjiro added this to the 4.3.0 milestone Aug 2, 2017
@ladz
Copy link

ladz commented Aug 9, 2017

I having the same issue in a CSS file

Please check validity of the block starting from line #3
CSScomb Core version: 4.2.0

1 | :root
2 | {
3*|   --one-third: calc(100%/3)
4 | }

@subblue
Copy link

subblue commented Nov 16, 2017

I'm also finding that CSSComb in VS Code fails on any file that has a calc(...) that uses a var(...)

For example:

[CSSComb]

Parsing error: /..../styles/UI.css
Please check validity of the block starting from line #65
CSScomb Core version: 4.2.0

64 |   height: 100%;
65*|   padding-top: calc(2 * var(--ui-unit));
66 |   border-right: none;

Syntax: css
Gonzales PE version: 3.4.7

My .csscomb.json config is:

{
  "exclude": ["node_modules/**"],
  "block-indent": "  ",
  "always-semicolon": true,
  "color-case": "upper",
  "color-shorthand": true,
  "element-case": "lower",
  "eof-newline": true,
  "leading-zero": true,
  "lines-between-rulesets": 1,
  "quotes": "double",
  "remove-empty-rulesets": false,
  "sort-order-fallback": "abc",
  "space-after-colon": " ",
  "space-after-combinator": " ",
  "space-after-opening-brace": "\n  ",
  "space-after-selector-delimiter": "\n",
  "space-before-closing-brace": "\n",
  "space-before-colon": "",
  "space-before-combinator": " ",
  "space-before-opening-brace": " ",
  "space-before-selector-delimiter": "",
  "space-between-declarations": "\n  ",
  "strip-spaces": true,
  "tab-size": true,
  "unitless-zero": true,
  "vendor-prefix-align": false,
  "sort-order": [ ... ]
}

Thanks

@softshape
Copy link

CSSComb for Visual Studio Code fails on CSS variable declaration -

Please check validity of the block starting from line #7
CSScomb Core version: 4.2.0

5 | --body-color: #434343;
6 | --content-background: #fff;
7*| --header-background: #666563;
8 | --dialog-background: #7050D6;
9 | --tab-background: #FFCC94;

Syntax: css
Gonzales PE version: 3.4.7

sameoldmadness added a commit to sameoldmadness/csscomb.js that referenced this issue Dec 15, 2017
@Mourdraug
Copy link

Is it something that got broken recently? Because according to #275 variables should be fixed in [email protected].

@adrianbienias
Copy link

VS Code 1.25.1

Please check validity of the block starting from line #3
CSScomb Core version: 4.2.0

1 | :root {
2 | --test-var: #fff;
3*| }

Syntax: css
Gonzales PE version: 3.4.7

@StructByLightning
Copy link

As far as I can tell, #275 is about scss variables but this error occurs when you try to declare a plain css variable.

Unsupported beautification result 'Parsing error: Please check validity of the block starting from line #19
CSScomb Core version: 4.2.0
18 | :root {
19*|   --body-bg: #020202;
20 | }
Syntax: scss
Gonzales PE version: 3.4.7'.

@jdalton
Copy link
Contributor

jdalton commented Apr 27, 2019

Fixed by #595.

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

10 participants