减少CSS扩展和伪类

时间:2016-02-11 19:07:58

标签: css css-selectors less extend pseudo-class

我使用以下代码:

  @Override 
  public void onMapReady(GoogleMap map) {

    this.map = map;

    map.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
        @Override 
        public View getInfoWindow(Marker marker) {
            return null; 
        } 
        @Override 
        public View getInfoContents(Marker marker) {
            View v = getLayoutInflater().inflate(R.layout.mapinfowindow,null);
            LatLng latLng =marker.getPosition();
            TextView tvLat = (TextView)findViewById(R.id.tvLat);
            TextView tvLng = (TextView)findViewById(R.id.tvLng);
            tvLat.setText(String.valueOf(latLng.latitude));
            tvLng.setText(String.valueOf(latLng.longitude));
            return v;
        } 
    }); 

} 

在less文件中,我有以下结构:

header {
    &:extend(.menu all);
}

在输出文件中,显示后出现.menu和.menu:的css。但不是.menu的代码:first-child或.menu:last-child。

但是,如果我将.menu:first-child或.menu:last-child更改为.menu:first和.menu:last则会显示css代码。

似乎连字符是问题。

知道如何解决这个问题吗?

感谢。

0 个答案:

没有答案
相关问题