0
Welcome Guest! Login
0 items Join Now

SOLVED Custom CSS - What am I doing wrong?

  • SOLVED Custom CSS - What am I doing wrong?

    Posted 9 years 1 month ago
    • I have my custom styles in /templates/rt_somaxiom/rt_somaxiom-custom.css. All styles are wrapped in #vaughan { ..my styles.. } (this is my client name), per Henning's tip and various other how-to posts by admins on this forum.

      The css shows in the head of the document. The body id tag is being applied. I've cleared caches in the system and in browsers.

      But despite all the above, None of my custom styles are taking effect. I *think* I'm doing everything right so I'm stumped.

      www.my-site.com

      Why?? Can anyone figure it out??
    • Last Edit: 9 years 1 month ago by DeLongDesign.
    • David Goode's Avatar
    • David Goode
    • Preeminent Rocketeer
    • Posts: 17058
    • Thanks: 890
    • Web Designer and Host

    Re: Custom CSS - What am I doing wrong?

    Posted 9 years 1 month ago
    • Hi there,

      You have misunderstood the instructions. :blush:

      The only place you can do as you have done e.g #vaughan { ALL YOUR CSS } is if you are saving to a LESS file and not CSS.

      This means you would have to create a custom LESS file (instructions here - www.gantry-framework.org/documentation/j...custom_stylesheet.md )

      Hope this helps 8)

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information
  • Re: Custom CSS - What am I doing wrong?

    Posted 9 years 1 month ago
    • Thank you David, I see that now in Henning's tip:
      even more useful when you are coding LESS.

      just use nested code like

      #force {
      ...
      all your custom rules can go in here
      ...
      }

      Wouldn't it be Neat if Gantry automatically added specificity to duplicate css rules in (templatename)-custom.css files? Gantry looks for the custom css but then we have to manually add specificity to make it work. It's kind of half baked.
    • David Goode's Avatar
    • David Goode
    • Preeminent Rocketeer
    • Posts: 17058
    • Thanks: 890
    • Web Designer and Host

    Re: Custom CSS - What am I doing wrong?

    Posted 9 years 1 month ago
    • Hi there,

      The trouble with duplication is that Gantry is not a mind reader so it does not know what you want to achieve, or if your new duplicated rule was simply a typo because you missed a class or # or .

      We provide the spectacular templates, amazing extensions, flexible framework so I guess we need to leave something for the web developers to do or they would all be out of work! ;)

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information
  • Re: Custom CSS - What am I doing wrong?

    Posted 9 years 1 month ago
    • David,

      Yes, you wouldn't want to make things too easy or you'd have too few questions to answer and the forum moderators might be out of work. Probably no danger of either scenario.

      I could easily foresee this feature being added as a toggle in template style > Advanced. "Force custom css : : On/Off"

      Thanks again for your help.

Time to create page: 0.058 seconds