3

I am getting warnings and errors on the following rules;

#data{
display: grid;
grid-column-gap: 20px;
grid-row-gap: 10px;
grid-template-columns: [label] 150px [field] 1fr;}

The warnings are on grid-column-gap and grid-row-gap which are "unknown property" and the error on grid-template-columns is "unexpected token LBRACKET".

If I remove the named columns I just end up with "unknown property" on grid-template-columns.

I have cleared out the cache but to no avail. Am I missing a recent css file or what?

I am using Node.js 8 on Ubuntu 16.04 LTS.

Any help will be much appreciated.

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
reg1965
  • 147
  • 3
  • 8
  • The `grid-column-gap` and `grid-row-gap` properties are on the way out. They have been replaced by `column-gap` and `row-gap`, although I doubt that's the reason for the error, as this transition is happening now and the older properties should still work. https://stackoverflow.com/a/50919533/3597276 – Michael Benjamin Jun 25 '18 at 17:48
  • @Michael_B I am getting the same warnings for the newer properties also. In fact all grid properties are missing from code completion to boot. – reg1965 Jun 25 '18 at 18:36
  • 1
    @Michael_B You are right. I will have to soldier on until v9 at least. Or switch to a better free IDE for Ubuntu. – reg1965 Jun 25 '18 at 19:19
  • 1
    @Michael_B This is not a duplicate of [Netbeans CSS not hinting all properties](https://stackoverflow.com/questions/49052178/netbeans-css-not-hinting-all-properties) for which [I raised a Bug Report](https://issues.apache.org/jira/browse/NETBEANS-445). That related to NetBeans not providing hints for certain **display** properties, so it was a cosmetic error. The issue the OP here is facing is more fundamental: some valid properties are deemed invalid when using **display:grid**. The problems may or may not be related but they are qualitatively different, and this post should be reopened. – skomisa Jun 25 '18 at 19:52
  • @skomisa, okay. Since the OP agreed with my "duplicate" comment, I then followed up with a duplicate closure. But I've reopened. – Michael Benjamin Jun 25 '18 at 19:53
  • 2
    @Michael_B, The real annoyance of this is that the false positives that Netbeans 8.2 is flagging MAY in fact mask other REAL errors that then take longer to identify and fix. I have been using Netbeans for a couple of months because it's support for HTML/CSS/JS are far superior to Eclipse. This is the first problem I'ved faced with Netbeans since having started using grid layout which is the dog's danglies as far as I'm concerned. Annoying...GRRRR! – reg1965 Jun 26 '18 at 11:52

1 Answers1

2

This question is closely related to another on SO, but it is not a duplicate: Netbeans CSS not hinting all properties.

That post related to NetBeans not providing auto-completion hints for certain valid values of the CSS display property. Your question shows that the problem is more extensive and more serious in several ways:

  • It is not just CSS display values that are not offered by autocomplete in NetBeans. For example, the properties row-gap and grid-column-gap are not suggested, yet column-gap is!
  • The problem is not confined to auto-complete being unhelpful. It appears that any valid property value which is not offered by autocomplete will also be reported as a CSS parsing error by NetBeans when used in CSS code. For example, autocomplete does not offer grid-column-gap as an option, and it is also reported as an error: "Unknown property grid-column-gap".
  • Although autocomplete does not offer grid or flex as options for the display property, their use is not treated as an error when used in CSS code, but that is because any value for display is accepted.
  • As you point out, the more insidious aspect of the bogus reporting of errors is that it can make it harder to identify real problems in your CSS code.

NetBeans allows you to filter out specific parsing errors, or all parsing errors in a file or the entire project, but none of those options really help. Unfortunately I don't know of any real solution in the short term; NetBeans needs to be fixed.

I have updated an existing NetBeans Bug Report to clarify that the problem is more serious and extensive than originally reported. Also, the issue is not fixed with Apache NetBeans 9.0 RC1.

The only good news is that despite NetBeans incorrectly reporting errors for some valid CSS properties the application will run just fine, but you probably know that already.

I'll update this answer when there is a fix for this issue in NetBeans.

skomisa
  • 16,436
  • 7
  • 61
  • 102
  • As you say, quite correctly, my code runs just fine. But many many thnx for updating the bug report on this issue. I'm not going to ditch Netbeans but will program with an alerted eye on CSS errors in future!! Thnx again mate. – reg1965 Jun 27 '18 at 08:06
  • There is also the error on named columns and I assume rows. – reg1965 Jun 27 '18 at 18:17
  • @reg1965 Good point - I'd missed that on the bug report, and will update it, though I suspect that might not be an issue as long as the property is recognized. – skomisa Jun 27 '18 at 18:39
  • 3
    UPDATE: I have installed V11.0 and the same problem exists! CSS Grid is just about the most important addition in the last few years, yet Apache just don't seem to care..why? – reg1965 Nov 17 '19 at 13:06
  • 1
    2 years later and the same bug is there, my CSS is lit up as its grid driven, and yet no actual errors. – Jon Jul 09 '20 at 02:15
  • Another 2 years later, still same thing - I came back to this SO thread to deal with _ul_ `margin-block-start` & `margin-block-end` as I don't want those big default gaps, I zero them out of an "unknown property". – Jon Sep 06 '22 at 02:47
  • @Jonathan I just checked the bug report I had raised in 2018 ([NETBEANS-445 Many missing values for code completion of the CSS display property](https://issues.apache.org/jira/browse/NETBEANS-445)) and it was closed with _Resolution:_ "Fixed", with _Fix Version/s:_ being "NetBeans 12.0". What version of NetBeans are you using? – skomisa Sep 06 '22 at 03:02
  • @skomisa : Product Version: Apache NetBeans IDE 14 Java: 15; Java HotSpot(TM) 64-Bit Server VM 15+36-1562 Runtime: Java(TM) SE Runtime Environment 15+36-1562; all up-to-date. https://i.imgur.com/cZZ3wNu.png – Jon Sep 06 '22 at 13:43
  • Sorry for double post, just saw there is a NetBeans 15! (The Update doesn't say, need to check the NB webpage.) Anyway, installed, opened this project, and, same bug!! :) – Jon Sep 06 '22 at 14:01
  • @Jonathan OK. The closed bug report was unclear on what was actually fixed. Can you post a new question here for NetBeans 14 (or 15!) citing the properties that still aren't working for you? I think that is more helpful to the community than discussing it here, since it looks like it may be appropriate to raise a new bug report with NetBeans. – skomisa Sep 06 '22 at 17:38