Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 925417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:31:01+00:00 2026-05-15T19:31:01+00:00

This problem is best described with an example. I have the following ClientBundle in

  • 0

This problem is best described with an example.

I have the following ClientBundle in my GWT app:

interface Resources extends ClientBundle {
    public static final Resources INSTANCE = GWT.create(Resources.class);

    @Source("defines.css")
    Defines defines();

    @Source("appStyle.css")
    @CssResource.NotStrict
    Style style();

    interface Style extends CssResource {
        String appLogo();
        (...)
    }

    interface Defines extends CssResource {
        String formInputBackgroundColor();
        String formInputBorderColor();
        (...)
    }
}

The appStyle.css is the main stylesheet used by the application and the defines.css is a stylesheet containing only constants like:

@def formInputBackgroundColor #D8ECFD;
@def formInputBorderColor #7FAAFF;
(...)

Now I can use the constants in the defines.css stylesheet inside UIBinder templates and in application code without problems, but I can’t use those constants in my appStyle.css.

I have already tried replacing interface Style extends CssResource with interface Style extends Defines, hoping that inheriting from the Defines stylesheet would give me access to the constants in the “child” Style stylesheet, but then the GWT compiler complains with errors like:

Rebinding my.project.client.resources.Resources
    Creating assignment for style()
        Replacing CSS class names
            The following obfuscated style classes were missing from the source CSS file:
                formInputBorderColor: Fix by adding .formInputBorderColor{}
                formInputBackgroundColor: Fix by adding .formInputBackgroundColor{}
                (...)

Is there any way to achieve this?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:31:02+00:00Added an answer on May 15, 2026 at 7:31 pm

    I found a way to do it, but it’s far from elegant and I would prefer another solution, like using some kind of inheritance or Annotations, if possible.

    The way I got it to work is to @eval every constant I need from defines.css in the appStyle.css stylesheet, but that leads to a lot of code duplication and it’s a mess to mantain.

    @eval formInputBackgroundColor Resources.INSTANCE.defines().formInputBackgroundColor();
    @eval formInputBorderColor Resources.INSTANCE.defines().formInputBorderColor();
    

    If you have a better solution, please share.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for the generally accepted/best solution to this problem. Problem I have a
I think my question is best described as an example. Let's say I have
What is the best way to solve this problem in code? The problem is
This problem may seem like school work, but it isn't. At best it is
What would be the best algorithm to solve this problem? I spent a couple
This is a bit of an involved problem, so I'll do the best I
This problem has been bugging me for a long time. For example, the code
I was wondering what the best approach would be to the following problem. Say
This question is about how to best name RSpec example groups and examples in
I'm not sure how to describe this problem, so I think an example is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.