1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Font-weight incorrect processing in templates

Discussion in 'Resolved Bug Reports' started by CyberAP, Aug 26, 2011.

  1. CyberAP

    CyberAP Well-Known Member

    If I open a template that contains property group and include there my font-weight with unusual number (for e.x. 300) it automatically converts to XenForo default, i.e. Font-weight: normal. Sometimes I get font-weight: bold. I think the same thing will happen with font-weight: light.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I tested it and got a different result. I edited the body class in xenforo.css. I added font-weight:

    Code:
    body
    {
    	@property "body";
    	font-weight: 300;
    	font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif;
    	color: @contentText;
    	word-wrap: break-word;
    	line-height: 1.27;
    	@property "/body";
    }
    
    It was converted to this upon saving and reloading the template:

    Code:
    body
    {
    	@property "body";
    	font-weight: 300px;
    	font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif;
    	color: @contentText;
    	word-wrap: break-word;
    	line-height: 1.27;
    	@property "/body";
    }
    
    300px isn't even valid.

    http://www.w3schools.com/cssref/pr_font_weight.asp
     
  3. Luciano

    Luciano Member

    well I use the "word" parameters vs the digits..
    they seem to work correctly.
    i.e.:
    normal | bold | bolder | lighter | inherit

    this always worked for me...
    i never touched the digits because I think I read somewhere that most fonts only have few weights available .
    so if the weight doesnt exist, it should default to the next available, but sometimes depending on browser it could give unpredictable results.
    and if you want to use 300, it will still display 400, if it is the only one available. (this is font dependant)

    but you are right, adding "px" to the value is definetively wrong.
    Luc
     
  4. Mike

    Mike XenForo Developer Staff Member

    Fixed now. This only occurred with a font-weight rule specifically. The font rule handles it, though it does just convert everything to bold.
     
    CyberAP likes this.
  5. CyberAP

    CyberAP Well-Known Member

    Not exactly what I wanted, but thanks!
     

Share This Page