0
Welcome Guest! Login
0 items Join Now

SOLVED Custom less file is not working

    • maxfer's Avatar
    • maxfer
    • Newbie
    • Posts: 6
    • Thanks: 0
    • System Admin Joomla Site Creator

    SOLVED Custom less file is not working

    Posted 11 years 2 months ago
    • Hello,

      I have Gantry 4.1.20 and Hadron Template.

      I changed Social Buttons from navigation-b position to header-b position, and I want to keep the buttons style.

      I created a demo-custom.less in templates/rt_hadron/less/ dir with the content:
      // Header Social Buttons
      #rt-header {
          .rt-social-buttons{
              float:right;
              margin:10px 0;
              padding:15px 0;
              width:200px;
              position:relative;
              z-index:10;
          }
       
          .social-button-text{
              display:none;
          }
       
          .social-button{
              color:lighten(@navigation-text-color, 10%) \9;
              border:2px solid lighten(@navigation-text-color, 10%) \9;
              color:fadeout(@navigation-text-color, 50%);
              border:2px solid fadeout(@navigation-text-color, 50%);
              border-radius:@base-border-radius;
              display:inline-block;
              width:44px;
              height:44px;
              line-height:44px;
              margin:0 -1px;
              padding:0;
              text-align:center;
       
              &:hover {
                  color:@button-text-color;
                  background:@button-background;
                  border:2px solid transparent;
              }
          }
      }
       
      // Large Mode
      @media only screen and (min-width: 1200px) {
          body.layout-mode-responsive {
              #rt-header .rt-social-buttons {
                  margin-right: -140px;
              }
          }
      }       
       
      // Desktop Modes
      @media only screen and (min-width: 960px) and (max-width: 1199px) {
          body.layout-mode-responsive {
              #rt-header .rt-social-buttons {
                  margin-right: -100px;
              }       
          }
      }   
       
      // Tablet Modes
      @media only screen and (min-width: 768px) and (max-width: 959px) {
          body.layout-mode-responsive {
              #rt-header .rt-social-buttons {
                  margin-right: -68px;
              }       
          }
      }
       
      // Mobile Modes
      @media (max-width: 767px) {
          body.layout-mode-responsive {
              #rt-header .rt-social-buttons {
                  display: none;
              }       
          }
      }
       

      The problem is that master-7f...css CSS compiled file doesn't reflect the changes.
      I must to edit rt_hadron/less/global.less and add:
      @import "template-custom.less";

      What is wrong?
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Custom less file is not working

    Posted 11 years 2 months ago
    • Your statements need to have a higher level of CSS specifity on them in order to override the template values (google CSS specifity to learn more).

      Regards, Mark.
    • 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.
    • maxfer's Avatar
    • maxfer
    • Newbie
    • Posts: 6
    • Thanks: 0
    • System Admin Joomla Site Creator

    Re: SOLVED Custom less file is not working

    Posted 11 years 2 months ago
    • Works like a charm!

      Thank you!

Time to create page: 0.046 seconds