Javafx Css variable definition issue: Parsing error occurred when expecting a numeric value for the 'font-size' property

Encountering a JavaFX CSS parse error when trying to define new variables in CSS.

It works fine with constants like: -fx-font-size: 10;

Check out the code snippet below:

.root {
    tab-label-text-size: 10;
}
.label {
    -fx-font-size: tab-label-text-size;
}

Despite various attempts, unable to resolve this exception. Other variables used similarly work without any issues.

Expected '' while parsing '-fx-font-size' at [9,19]

Potentially a bug in JavaFX?

Answer №1

JavaFX CSS allows for the assignment of color constants like this:

* {
    -color : #f44242;
}

.button {
    -fx-text-fill: -color;
}

However, it's worth noting that font size constants are currently unsupported by the CssParser

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to Convert HttpInputStream to a PDF in Grails

When executing the following code, the output appears corrupted like this: %PDF-1.4 % 4 0 obj <>stream x3P0T5T0P034ɹ\\N!\f f !)\!\\ %@(Dɹ i . h@]zPF endstream endobj 6 0 obj <>/ProcSet [/PDF /Text /ImageB /Image ...

Transitioning from LESS to SASS involves adapting responsive breakpoints

Adapting from Less to Sass has been my current focus. I have defined responsive breakpoints in Less variables: /* Breakpoints */ @break1:~"(max-width: 570px)"; @break2:~"(min-width: 571px) and (max-width: 1002px)"; @break3:~"(min-width: 1003px)"; These ...

Switch the Header Image on a Page in WordPress

I am currently using the Sunrise Theme from s5themes.com and I have a question regarding the header image on individual pages. It seems that all pages are displaying the same header image as the homepage, which is not what I want. Attached below is a scre ...

Fetching array data from database for a single column in string format

I designed an app that includes 7 checkboxes to collect the names of days from users. The selected names are stored in an array, converted into a string, and then saved in a database. Now, I am facing the challenge of retrieving this data as an array again ...

Is there a way to automatically display the first highlighted fragment in reveal.js?

Is it possible to have the first fragment automatically visible in reveal.js? I am utilizing the text colour highlight feature in reveal.js to make the most recent fragment appear with a slightly brighter color, drawing attention to that specific section. ...

How can CSS be used to create rounded corners on an entire webpage?

Looking for advice on how to enhance the appearance of my Progressive Web App (PWA) on devices with a "notch". I have sketched out the design with red arrows. If you need to inspect the CSS classes, you can visit my website at . I am seeking recommendation ...

Progress bar display not available

I have recently developed a JavaScript quiz application and included a progress bar feature. While it works flawlessly offline on my laptop, I encountered an issue when uploading the files to Codepen.io - the progress bar fails to display. I would appreci ...

I'm struggling to adjust the height of a div based on whether a list item within it contains a nested unordered

I have been working on a horizontal menu that is functioning well for me. However, according to the design requirements, I need to adjust the height of <div id="nav-subMenu"></div> if the main/parent menu li does not have any submenus or ul. Th ...

Animating the size of an element with dynamic content

I am working on a feature where clicking on a card should display a summary. When a new summary is shown, I want the summary container to animate and align its position with the associated card (top). However, despite my efforts, I am facing an issue whe ...

Preventing click events with pointer-events property in CSS while still allowing scrolling

Is there a way to use pointer-events: none to disable click events on a specific container while still allowing scroll functionality and an overlay? You can view my fiddle here: https://jsfiddle.net/1eu6d3sq/1/ Currently, when I apply pointer-events: non ...

Background image vanishes after the second invocation of Codeigniter View

Currently, I am working with codeigniter and have successfully set a background image for my home page. However, when I call the view explicitly from another function, the background image disappears while everything else remains unchanged. In my header_v ...

What is the best way to connect multiple web pages together?

Hello everyone, I could really use some assistance with a problem I'm facing. As a newcomer to web development, I have a question about navigation bars. I've successfully created a basic webpage with a navigation bar, but now I'm unsure how ...

The functionality of the Bootstrap dropdown list button is not functioning properly on mobile devices

Currently, I am in the process of developing a website and testing its mobile view on my iPhone. The website is still using bootstrap 3, but I have encountered some issues. When I tap on the navigation button on my iPhone, nothing happens - no dropdown lis ...

Arranging divs in a row using jQuery sortable technique

Greetings! I have been attempting to achieve horizontal sorting for two divs but have encountered a couple of issues. Firstly, the divs do not align correctly upon initial page load and secondly, while they can be dragged around, the sortable functionality ...

Hide the scrollbars on the sidebar

I'm attempting to recreate a sleek scrollbar that caught my eye on the website . To achieve this, I need to have a screen larger than 955px in order to display the sidebar. However, when my sidebar overflows in the y direction, it causes an additional ...

Challenge with line breaking and shortening lengthy content in Angular

Struggling with properly wrapping and truncating long text in an Angular project. The goal is to wrap the text in 2 lines and if it goes beyond that, add "..." at the end of the second line. Pure CSS doesn't work because the text needs to be left-alig ...

Simple steps on incorporating a toggler button to collapse the header using Bootstrap

As a beginner in web development, I am facing challenges adding the collapse toggler to my code. I have tried various methods but have not been successful. Can someone please provide assistance? Below is the code snippet: <body> <div clas ...

Replacing menu styling with JavaScript using C#

I'm currently working on a C# project to develop a smartphone-friendly website for motorists to easily pay their parking fees. However, I'm facing some challenges with the menu design. My goal is to have a white menu with black text, where the cu ...

Unexpected behavior when using padding on the left side of a vertical position

I can't seem to figure out a strange issue. I have a div containing multiple paragraphs, but when I adjust the padding left within the div to align all paragraphs to the left, they not only shift to the left but also move up as if I'm positioning ...

Rearrange two elements by flipping their positions using CSS

I'm working with the following div that contains an input and a label: <div class="js-form-item "> <input type="checkbox" id="checkboxes-11" class="type-checkboxes form-checkbox"> <label for="option-a-checkboxes-11" class=" ...