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

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:

主站蜘蛛池模板: 临泽县| 玉树县| 柯坪县| 普格县| 克山县| 鲜城| 翁牛特旗| 霸州市| 石柱| 彰化县| 大方县| 新兴县| 方城县| 盘锦市| 星座| 清涧县| 安多县| 兴义市| 临澧县| 嘉鱼县| 玉环县| 娱乐| 甘洛县| 苏州市| 资阳市| 平定县| 璧山县| 南和县| 枝江市| 保定市| 上虞市| 凌云县| 左云县| 龙江县| 蒲城县| 莎车县| 静海县| 寿宁县| 宁陵县| 绩溪县| 福州市|