Projet

Général

Profil

0001-general-add-basic-scss-blocks-and-publik-scss-to-use.patch

Frédéric Péters, 04 octobre 2015 19:20

Télécharger (15,4 ko)

Voir les différences:

Subject: [PATCH] general: add basic scss blocks and publik-scss to use them
 (#8504)

 Makefile                               |   2 +-
 debian/control                         |   2 +-
 static/custom-publik-scss/_custom.scss |  54 +++++++++++++
 static/custom-publik-scss/logo.png     | Bin 0 -> 1460 bytes
 static/custom-publik-scss/style.scss   |  23 ++++++
 static/includes/_cells.scss            |  58 ++++++++++++++
 static/includes/_forms.scss            |  16 ++++
 static/includes/_general.scss          |  29 +++++++
 static/includes/_layout.scss           |  69 ++++++++++++++++
 static/includes/_misc.scss             |  20 +++++
 static/includes/_nav.scss              | 141 +++++++++++++++++++++++++++++++++
 static/includes/_user-info.scss        |  16 ++++
 static/includes/_wcs.scss              |  46 +++++++++++
 template.py                            |   3 +-
 14 files changed, 475 insertions(+), 4 deletions(-)
 create mode 100644 static/custom-publik-scss/_custom.scss
 create mode 100644 static/custom-publik-scss/logo.png
 create mode 100644 static/custom-publik-scss/style.scss
 create mode 100644 static/includes/_cells.scss
 create mode 100644 static/includes/_forms.scss
 create mode 100644 static/includes/_general.scss
 create mode 100644 static/includes/_layout.scss
 create mode 100644 static/includes/_misc.scss
 create mode 100644 static/includes/_nav.scss
 create mode 100644 static/includes/_user-info.scss
 create mode 100644 static/includes/_wcs.scss
Makefile
4 4
prefix = /usr
5 5

  
6 6
all:
7
	@(echo "Nothing to build. Please use make install.")
7
	cd static/custom-publik-scss/ && sass style.scss:style.css
8 8

  
9 9
clean:
10 10
	rm -rf sdist
debian/control
2 2
Section: web
3 3
Priority: optional
4 4
Maintainer: Frédéric Péters <fpeters@entrouvert.com>
5
Build-Depends: debhelper (>= 8.0.0)
5
Build-Depends: debhelper (>= 8.0.0), ruby-sass
6 6
Standards-Version: 3.9.4
7 7
Homepage: http://git.entrouvert.org/publik-base-theme.git
8 8

  
static/custom-publik-scss/_custom.scss
1
body {
2
	background: #fcfcfc;
3
}
4

  
5
body {
6
	border-top: 3px solid $nav-selected-color;
7
}
8

  
9
h1#logo {
10
	background: url(logo.png) no-repeat left bottom;
11
	padding-top: 35px;
12
	font-size: 25px;
13
	font-weight: normal;
14
	& a {
15
		text-decoration: none;
16
	}
17
}
18

  
19
div#nav a {
20
	font-weight: normal;
21
}
22

  
23
div#nav ul {
24
	box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.16), 0px 2px 10px 0px rgba(0, 0, 0, 0.12);
25
}
26

  
27
div#services > ul > li > strong > a,
28
#content div.textcell h2:first-child,
29
#content div.cell h2:first-child {
30
	overflow: hidden;
31
}
32

  
33
div#services > ul > li > strong > a:after,
34
#content div.textcell h2:first-child:after,
35
#content div.cell h2:first-child:after {
36
	width: 20%;
37
	height: 200%;
38
	background: rgba(255, 255, 255, 0.1) none repeat scroll 0% 0%;
39
	z-index: 1;
40
	right: -10%;
41
	top: 0px;
42
	margin: -5px 0px 0px -5px;
43
	transform-origin: 0px 0px 0px;
44
	transform: rotate(-20deg);
45
	content: "";
46
	position: absolute;
47
	transition: all 0.3s ease 0s
48
}
49

  
50
div#services > ul > li:hover > strong > a:after,
51
#content div.textcell:hover h2:first-child:after,
52
#content div.cell:hover h2:first-child:after {
53
	width: 30%;
54
}
static/custom-publik-scss/style.scss
1
@charset "UTF-8";
2

  
3
$font-size: 13px !default;
4
$font-family: sans-serif !default;
5
$nav-background: #E80E89;
6
$nav-color: white;
7
$nav-selected-color: #910956;
8
$border-radius: 3px;
9
$top-logo-width: 100px;
10
$button-background: $nav-background;
11
$title-background: #910956;
12
$title-color: white;
13

  
14
@import '../includes/general';
15
@import '../includes/layout';
16
@import '../includes/nav';
17
@import '../includes/cells';
18
@import '../includes/user-info';
19
@import '../includes/wcs';
20
@import '../includes/forms';
21
@import '../includes/misc';
22

  
23
@import 'custom';
static/includes/_cells.scss
1
$cell-border: 1px solid #ccc !default;
2
$cell-border-radius: $border-radius !default;
3

  
4
div#left div.block,
5
#content #left .cell { margin-left: 0; }
6
div#right div.block,
7
#content #right .cell { margin-right: 0; }
8

  
9
div#services > ul > li,
10
div.a2-block,
11
#content div.cell,
12
div.block {
13
	text-align: left;
14
	background: white;
15
	margin: 10px 10px;
16
	padding: 0;
17
	border-radius: $border-radius;
18
	border: $cell-border;
19

  
20
	& h2 + div {
21
		padding: 1em;
22
	}
23
}
24

  
25
div#services > ul > li > strong {
26
	padding: 0;
27
	margin: 0;
28
}
29

  
30
div#rub_service div.category h3,
31
#content div.block h2,
32
div#services > ul > li > strong > a,
33
#content div.textcell h2:first-child,
34
#content div.cell h2:first-child {
35
	@extend %title;
36
	border-bottom-left-radius: 0;
37
	border-bottom-right-radius: 0;
38
}
39

  
40
div#rub_service div.category ul,
41
div#services > ul > li > ul,
42
div.categoriescell ul,
43
div.wcsformsofcategorycell ul,
44
div.wcscurrentformscell ul {
45
	padding: 0;
46
	margin: 0;
47
	list-style: none;
48

  
49
	& a {
50
		padding: 1em;
51
		display: block;
52
		border-bottom: 1px solid #ccc;
53
		position: relative;
54
		&:hover {
55
			background: #eee;
56
		}
57
	}
58
}
static/includes/_forms.scss
1
$button-background: #37a7da !default;
2
$button-color: white !default;
3

  
4
input[type=submit],
5
div.buttons input {
6
	background: $button-background;
7
	color: $button-color;
8
	padding: 5px 15px;
9
	cursor: pointer;
10
	border: 1px solid transparent;
11
	transition: all 0.2s ease;
12

  
13
	&:hover {
14
		box-shadow: 0px 0px 5px #777;
15
	}
16
}
static/includes/_general.scss
1
$title-background: white !default;
2
$title-color: black !default;
3
$border-radius: 3px !default;
4

  
5
html, body {
6
	font-family: $font-family;
7
	font-size: $font-size;
8
	color: #333;
9
}
10

  
11
a {
12
	color: #028;
13
	text-decoration: none;
14
}
15

  
16
%title {
17
	display: block;
18
	position: relative;
19
	text-transform: none;
20
	background: $title-background;
21
	color: $title-color;
22
	padding: 1ex;
23
	border-radius: $border-radius;
24
	margin: 0;
25
	text-decoration: none;
26
	font-weight: normal;
27
	font-size: $font-size * 1.1;
28
	border: 0;
29
}
static/includes/_layout.scss
1
$width: 1000px !default;
2
$mobile-limit: 800px !default;
3
$footer-background: #666666 !default;
4
$footer-color: white !default;
5
$top-logo-width: 0 !default;
6

  
7
html, body {
8
	margin: 0;
9
}
10

  
11
div#footer, div#page {
12
	clear: both;
13
	max-width: $width;
14
	margin: 0 auto;
15
}
16

  
17
div#header {
18
	width: 100%;
19
	margin: 0 0 0 0;
20
	position: relative;
21
	top: 0px;
22
	z-index: 0;
23
	padding: 0 1ex;
24
	& h1 {
25
		margin: 0;
26
	}
27
	@media screen and (max-width: $mobile-limit) {
28
		position: absolute;
29
		& h1 {
30
			padding-left: $top-logo-width+70px;
31
			background-position: 70px;
32
		}
33
	}
34
}
35

  
36
div#main-content-wrapper {
37
	position: relative;
38
	z-index: 100;
39
	max-width: $width;
40
	margin: 0px auto 0px auto;
41
	padding: 0 1ex;
42
}
43

  
44
div#main-content {
45
	margin: 0;
46
	min-height: 300px;
47
}
48

  
49
@media screen and (min-width: $mobile-limit) {
50
	#right {
51
		float: right;
52
		width: 49.5%;
53
	}
54
	#left {
55
		float: left;
56
		width: 49.5%;
57
	}
58
}
59

  
60
#footer-wrapper {
61
	clear: both;
62
	padding: 1ex 0 2ex 0;
63
	background: $footer-background;
64
	color: $footer-color;
65
}
66

  
67
h1#logo {
68
	padding-left: $top-logo-width;
69
}
static/includes/_misc.scss
1
div.textcell p {
2
	margin: 1ex;
3
}
4

  
5
div#footer div.cell.test-banner {
6
	position: fixed;
7
	top: 2em;
8
	right: -5em;
9
	background: red;
10
	width: 15em;
11
	z-index: 1000;
12
	transform: rotate(45deg);
13
	transform-origin: center center;
14
	text-align: center;
15
	border-radius: 10px;
16
}
17

  
18
div#footer div.cell.test-banner p {
19
	margin: 0;
20
}
static/includes/_nav.scss
1
$nav-background: white !default;
2
$nav-color: black !default;
3
$nav-selected-color: #005EA9 !default;
4
$nav-height: 3em !default;
5
$mobile-limit: 800px !default;
6
$nav-menu-side: 50px !default;
7
$border-radius: 0 !default;
8

  
9
div#nav {
10
	background: $nav-background;
11
	color: $nav-color;
12
	padding: 0;
13
	margin: 10px 0px;
14
	height: $nav-height;
15
	border-radius: $border-radius;
16
}
17

  
18

  
19
div#nav ul {
20
	border-color: $nav-selected-color;
21
	height: $nav-height;
22
	padding: 0;
23
}
24

  
25
div#nav ul li:first-child a {
26
	border-radius: $border-radius 0 0 $border-radius;
27
}
28

  
29
div#nav a {
30
	color: $nav-color;
31
	font-weight: bold;
32
	padding: 0px 20px;
33
	display: inline-block;
34
	line-height: 3em;
35
	transition: background 0.5s, color 0.5s;
36
	text-decoration: none;
37
}
38

  
39
div#nav li {
40
	float: left;
41
	display: inline-block;
42
	margin: 0;
43
	padding: 0;
44
}
45

  
46
div#nav li:hover a,
47
div#nav li.selected a {
48
	background-color: $nav-selected-color;
49
	color: $nav-color;
50
}
51

  
52
#nav-button {
53
	display: none;
54
	border-radius: $border-radius;
55
}
56

  
57
@media screen and (max-width: $mobile-limit) {
58
	div#nav {
59
		height: auto;
60
		background: transparent;
61
	}
62
	div#nav #nav-button {
63
		display: block;
64
		position: relative;
65
		width: $nav-menu-side+2px;
66
		height: $nav-menu-side;
67
		padding: 0;
68
		margin: 0;
69
		background: $nav-selected-color;
70
		transition: all 0.25s ease;
71
		border: 0;
72
		& .sr-only {
73
			display: none;
74
		}
75
		& .icon-bar {
76
			position: absolute;
77
			top: 0px;
78
			left: $nav-menu-side/6;
79
			width: $nav-menu-side/6*4;
80
			margin: 0;
81
			border: 1px solid white;
82
			transition: all 0.25s ease;
83
		}
84
		& .icon-bar + .icon-bar {
85
			xxmargin-top: $nav-menu-side/10;
86
		}
87
		& .icon-bar-1 {
88
			top: $nav-menu-side/4;
89
		}
90
		& .icon-bar-2 {
91
			top: $nav-menu-side/2;
92
		}
93
		& .icon-bar-3 {
94
			top: $nav-menu-side/4*3;
95
		}
96

  
97
		& + ul {
98
			height: 0px;
99
			overflow: hidden;
100
			border-top: 2px solid $nav-selected-color;
101
			margin-top: 0;
102
			background: #eee;
103
			& a {
104
				color: black;
105
				border-radius: 0;
106
			}
107
			& li.selected a {
108
				color: white;
109
			}
110
		}
111

  
112
		& + ul li:last-child {
113
			border-bottom: 2px solid $nav-selected-color;
114
		}
115
	}
116
	div#nav #nav-button.toggled {
117
		& .icon-bar-1 {
118
			top: $nav-menu-side/2;
119
			transform: rotate(45deg);
120
		}
121
		& .icon-bar-2 {
122
			opacity: 0;
123
		}
124
		& .icon-bar-3 {
125
			top: $nav-menu-side/2;
126
			transform: rotate(-45deg);
127
		}
128

  
129
		& + ul {
130
			display: block;
131
			height: auto;
132
		}
133
		& + ul li {
134
			float: none;
135
			display: block;
136
		}
137
		& + ul li a {
138
			width: 100%;
139
		}
140
	}
141
}
static/includes/_user-info.scss
1
#toplinks {
2
	position: absolute;
3
	top: 0;
4
	left: auto;
5
	right: 1em;
6
	border-radius: 0 0 1em 1em;
7
	box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.16), 0px 2px 10px 0px rgba(0, 0, 0, 0.12);
8
	width: auto;
9
	padding: 1ex 2em 0.3ex 2em;
10
	border: 3px solid #910956;
11
	border-width: 0 1px 1px 1px;
12
}
13

  
14
#toplinks span.connected-user {
15
	padding-right: 1ex;
16
}
static/includes/_wcs.scss
1
div#services ul li li {
2
	list-style: none;
3
}
4

  
5
div#services > ul > li {
6
	margin: 0;
7
	margin-bottom: 10px;
8
	width: 100%;
9
}
10

  
11
div#rub_service h2 {
12
	@extend %title;
13
}
14

  
15
div.large div#rub_service h3,
16
div#rub_service h3 {
17
	border: none;
18
	text-align: left;
19
	border-bottom: 2px solid $title-background;
20
}
21

  
22
div#steps ol {
23
	& li {
24
		border: 0;
25
		border-bottom: 1px solid #ccc;
26
		margin-bottom: 2ex;
27
		border-radius: $border-radius;
28
	}
29
	& li.current {
30
		border: 0;
31
		background: $title-background;
32
		color: $title-color;
33
	}
34
}
35

  
36
li.required-authentication span {
37
	display: none;
38
}
39

  
40
li.required-authentication a:after {
41
	content: "\f084";
42
	font-family: FontAwesome;
43
	position: absolute;
44
	right: 1ex;
45
	color: #444;
46
}
template.py
46 46
        extra_head = """
47 47
[script]
48 48
<script type="text/javascript" src="/themes/publik-base/static/dataview.js"></script>
49
<link rel="stylesheet" type="text/css" href="[css]">
50 49
"""
51 50

  
52 51
        extra_top_head = """
53
<link rel="stylesheet" type="text/css" href="/qo/css/qommon.css">
52
<link rel="stylesheet" type="text/css" href="[css]">
54 53
"""
55 54

  
56 55
        user_info = """
57
-