Reduce the weight of a Glyphicon

后端 未结 4 824
抹茶落季
抹茶落季 2021-02-14 11:33

Is there a way to reduce the \"weight\" of Glyphicons?

I am using the \"ok\" Glyphicon which disp

相关标签:
4条回答
  • 2021-02-14 12:09

    Works on Different background-color.

    $(document).ready(function() {
        $( "[.fas || .glyphicon]" ).each(function( index ) {
          var color = $(this).parent().css("background-color");
          $(this).css("-webkit-text-stroke","2px "+color)
        });
    });
    

    Notice : choose one of .fas or .glyphicon .

    0 讨论(0)
  • 2021-02-14 12:11

    You could apply the font-weight property on ::before pseudo element to alter the font-weight:

    .glyphicon {
      font-size: 60px;
    }
    
    .glyphicon-light::before {
      font-weight: 100;
    }
    
    .glyphicon-thick::before {
      font-weight: 900;
    }
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    
    
    <span class="glyphicon glyphicon-search glyphicon-light"></span>
    
    <span class="glyphicon glyphicon-search"></span>
    
    <span class="glyphicon glyphicon-search glyphicon-thick"></span>

    0 讨论(0)
  • 2021-02-14 12:16

    Using white stroke is a way to do it

    -webkit-text-stroke: 2px white;
    
    0 讨论(0)
  • 2021-02-14 12:18

    You can also use opacity on the glyphicon if you do not want to apply this globally.

    <span style="opacity:0.25;" class="glyphicon glyphicon-ok"></span>
    
    0 讨论(0)
提交回复
热议问题