Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
7d3f2205
Commit
7d3f2205
authored
Mar 21, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Адаптивные таблицы
parent
225a1801
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
9 deletions
+85
-9
package.json
package.json
+2
-1
blocks-demo.html
src/blocks-demo.html
+53
-0
loader.scss
src/blocks/loader/loader.scss
+3
-0
table-responsive.scss
src/blocks/table-responsive/table-responsive.scss
+14
-8
table.scss
src/blocks/table/table.scss
+13
-0
No files found.
package.json
View file @
7d3f2205
...
...
@@ -39,7 +39,8 @@
"menu"
:
[],
"label"
:
[],
"loader"
:
[],
"table"
:
[]
"table"
:
[],
"table-responsive"
:
[]
},
"addCssBefore"
:
[
"./src/scss/variables.scss"
,
...
...
src/blocks-demo.html
View file @
7d3f2205
...
...
@@ -1321,6 +1321,59 @@
</section>
<section
class=
"blocks-library__item"
id=
"table-responsive"
data-name=
".table-responsive"
>
<h2
class=
"blocks-library__item-title"
>
Адаптивность для таблиц
</h2>
<p
class=
"alert alert--warning"
>
Требует добавления атрибутов
<code>
data-label
</code>
для каждой ячейки.
</p>
<table
class=
"table-responsive table"
>
<thead>
<tr>
<th>
Имя и фамилия
</th>
<th>
Тип мироощущения
</th>
</tr>
</thead>
<tbody>
<tr>
<td
data-label=
"Имя и фамилия"
>
Анатоле Вассерман
</td>
<td
data-label=
"Тип мироощущения"
>
Девственность
</td>
</tr>
<tr>
<td
data-label=
"Имя и фамилия"
>
Джакомо Казанова
</td>
<td
data-label=
"Тип мироощущения"
>
Небольшая распущенность с лёгкой примесью леденящих душу извращений, чудовищной лжи и имитатора известного органа, обитого телячьей кожей.
</td>
</tr>
</tbody>
</table>
<div
class=
"blocks-library__code-wrapper"
>
<span
class=
"blocks-library__code-show-trigger"
title=
"Показать код"
><i
class=
"blocks-library__code-icon"
></i></span>
<div
class=
"blocks-library__code"
>
<pre
class=
"code"
>
<code>
<
table class="table-responsive table">
</code>
<code>
<
thead>
</code>
<code>
<
tr>
</code>
<code>
<
th>Имя и фамилия
<
/th>
</code>
<code>
<
th>Тип мироощущения
<
/th>
</code>
<code>
<
/tr>
</code>
<code>
<
/thead>
</code>
<code>
<
tbody>
</code>
<code>
<
tr>
</code>
<code>
<
td data-label="Имя и фамилия">Анатоле Вассерман
<
/td>
</code>
<code>
<
td data-label="Тип мироощущения">Девственность
<
/td>
</code>
<code>
<
/tr>
</code>
<code>
<
tr>
</code>
<code>
<
td data-label="Имя и фамилия">Джакомо Казанова
<
/td>
</code>
<code>
<
td data-label="Тип мироощущения">Небольшая распущенность с лёгкой примесью леденящих душу извращений, чудовищной лжи.
<
/td>
</code>
<code>
<
/tr>
</code>
<code>
<
/tbody>
</code>
<code>
<
/table>
</code>
</pre>
</div>
</div>
</section>
</div>
<style>
...
...
src/blocks/loader/loader.scss
View file @
7d3f2205
...
...
@@ -2,6 +2,9 @@
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
$gray-lighter
:
hsl
(
0
,
0%
,
80%
)
!
default
;
$gray-lightest
:
hsl
(
0
,
0%
,
90%
)
!
default
;
.loader
{
display
:
inline-block
;
...
...
src/blocks/table-responsive/table-responsive.scss
View file @
7d3f2205
// Для импорта в диспетчер подключений: @import './src/blocks/table-responsive/table-responsive.less';
// В этом файле должны быть стили только для БЭМ-блока table-responsive, его элементов,
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
@import
'../../less/variables.less'
;
// только для удобства обращения к переменным
$border-color
:
hsl
(
0
,
0%
,
60%
)
!
default
;
$line-height
:
1
.375em
!
default
;
//------------------------------------------------------------------------------
// Адаптивные таблицы (требуют наличия атрибутов data-label на тегах td)
//------------------------------------------------------------------------------
$screen-xs
:
0
!
default
;
$screen-sm
:
480px
!
default
;
$screen-md
:
768px
!
default
;
$screen-lg
:
992px
!
default
;
$screen-xl
:
1200px
!
default
;
$screen-xxl
:
1800px
!
default
;
.table-responsive
{
@media
(
max-width
:
(
@
screen-md
-
1
))
{
@media
(
max-width
:
(
$
screen-md
-
1
))
{
display
:
block
;
border
:
0
;
...
...
@@ -29,11 +35,11 @@
tr
{
display
:
block
;
border
:
1px
solid
@
gray-lighte
r
;
border
:
1px
solid
$border-colo
r
;
border-bottom
:
0
;
&
:not
(
:last-child
)
{
margin-bottom
:
@
line-height
;
margin-bottom
:
$
line-height
;
}
}
...
...
src/blocks/table/table.scss
View file @
7d3f2205
...
...
@@ -2,6 +2,19 @@
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
$gray-lightest
:
hsl
(
0
,
0%
,
90%
)
!
default
;
$text-color--muted
:
hsl
(
0
,
0%
,
50%
)
!
default
;
$border-color
:
hsl
(
0
,
0%
,
60%
)
!
default
;
$font-size--small
:
0
.75em
!
default
;
$line-height
:
1
.375em
!
default
;
$field-padding-vertical
:
0
.3em
!
default
;
$field-padding-horizontal
:
0
.7em
!
default
;
.table
{
border-collapse
:
collapse
;
width
:
100%
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment