Opened 10 years ago

Closed 8 years ago

#14977 closed task (wontfix)

allow for overriding theme name

Reported by: ben hockey Owned by:
Priority: undecided Milestone: tbd
Component: Dijit - LnF Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by ben hockey)

in support was added that would make the following possible using lesscss:

@theme-name: claro;

~"[email protected]{theme-name}" .foo {
  color: blue;

will produce

.claro .foo {
  color: blue;

this would help towards providing a way for 2 versions of a theme to exist on a page at one time - or at least themes could be given alternate names. it wouldn't be a complete solution for having 2 versions but at least it gives some flexibility to developers.

the particular commit is not yet part of a tagged release of less and there are no tests covering this feature yet. i've opened a pull request that adds a regression test ( i'd say that we should at least wait for the next tagged release before we start using this and hopefully the regression test will be part of that release too.

at the same time, we may want to refactor our less files to follow this kind of nested structure:

// wrap the contents of the whole file with the theme-name
~"[email protected]{theme-name}" {
  .dijitCalendar {
    background-image: url("images/calendar.png"); // fallback for browsers that don't support CSS gradients

    .dj_ie6 & {
      background-image:none; // because on IE6 background-image overrides background-color

    img {
      border: none;

    // etc...


  // etc...


Change History (3)

comment:1 Changed 10 years ago by ben hockey

Description: modified (diff)

comment:2 Changed 10 years ago by bill

Looks good to me. Of course we could also achieve the same functionality with a plain regex inside of compile.js, but might as well do it through less.

And I agree, probably it would make the files a little nicer to do the nesting.

comment:3 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

In version two we aren't planning to have theme names (in the CSS files) at all. Each widget though will have it's own CSS files, which maybe achieves the same thing.

Note: See TracTickets for help on using tickets.