官术网_书友最值得收藏!

Styling the directory list

The directory list will be used for navigation through the file system, so we will wrap it with the nav > ul structure:

./index.html

<aside class="l-main__dir-list dir-list"> 
<nav>
<ul>
<li class="dir-list__li">..</li>
<li class="dir-list__li">assets</li>
<li class="dir-list__li">js</li>
<li class="dir-list__li">node_modules</li>
<li class="dir-list__li">tests</li></ul>
</nav>
</aside>

To support it with styles, we go with the following code:

./assets/css/Component/dir-list.css

.dir-list__li { 
padding: 0.8em 0.6em;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.dir-list__li:hover {
background-color: var(--dirlist-bg-hover-color);
color: var(--dirlist-fg-hover-color);
}

Note that we've just introduced a couple of variables. Let's add them in the definitions module:

./assets/css/Base/definitions.css

  --dirlist-bg-hover-color: #d64937; 
--dirlist-fg-hover-color: #ffffff;

As we ruin the application we can observe the new contents in the directory list:

主站蜘蛛池模板: 区。| 盐津县| 阿鲁科尔沁旗| 资源县| 阜新| 龙泉市| 额敏县| 商城县| 全椒县| 桑植县| 哈巴河县| 从化市| 九寨沟县| 银川市| 喜德县| 八宿县| 汉阴县| 兰州市| 乌什县| 土默特右旗| 庆云县| 怀宁县| 九江县| 石狮市| 宁河县| 毕节市| 许昌县| 哈尔滨市| 桦南县| 灵丘县| 平武县| 开封县| 龙胜| 理塘县| 中牟县| 扶余县| 正宁县| 临猗县| 万年县| 大埔区| 延津县|