Skip to content

Commit 72834cb

Browse files
authored
Merge pull request #51 from ashwinvis/fix/flex-width
Responsive CSS grid stylesheet
2 parents 121d37d + 1785721 commit 72834cb

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

github-markdown.css

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ html {
1010
}
1111

1212
body {
13-
min-width: 1020px;
1413
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
1514
/* color: #333; */
1615
background-color: #fff;
@@ -31,22 +30,27 @@ td,th {
3130
}
3231

3332
.container {
34-
width: 980px;
33+
display: grid;
34+
grid-template-columns: 0.5em 1fr 0.5em;
35+
grid-template-rows: 0fr 1fr 0fr;
36+
max-width: 1020px;
3537
margin-right: auto;
3638
margin-left: auto
3739
}
3840

3941
.container:before {
40-
display: table;
4142
content: ""
4243
}
4344

4445
.container:after {
45-
display: table;
4646
clear: both;
4747
content: ""
4848
}
4949

50+
.item {
51+
display: flex;
52+
}
53+
5054
.boxed-group {
5155
position: relative;
5256
border-radius: 3px;
@@ -68,19 +72,17 @@ td,th {
6872
}
6973

7074
.repository-with-sidebar:before {
71-
display: table;
7275
content: ""
7376
}
7477

7578
.repository-with-sidebar:after {
76-
display: table;
7779
clear: both;
7880
content: ""
7981
}
8082

8183
.repository-with-sidebar .repository-sidebar {
8284
float: right;
83-
width: 38px
85+
width: 38px;
8486
}
8587

8688
.repository-with-sidebar .repository-sidebar .sidebar-button {
@@ -102,7 +104,7 @@ td,th {
102104
}
103105

104106
.repository-with-sidebar .repository-sidebar .clone-url.open {
105-
display: block
107+
display: flex;
106108
}
107109

108110
.repository-with-sidebar .repository-sidebar .clone-options {
@@ -119,13 +121,19 @@ td,th {
119121
cursor: pointer
120122
}
121123

122-
.repository-with-sidebar .repository-content {
123-
/* float: left; */
124-
width: 920px;
124+
.repository-with-sidebar, .repository-content {
125+
float: left;
126+
width: 100%;
127+
}
128+
129+
@media (min-width: 1020px) {
130+
.repository-with-sidebar, .repository-content {
131+
width: 1020px;
132+
}
125133
}
126134

135+
127136
.repository-with-sidebar.with-full-navigation .repository-content {
128-
width: 790px;
129137
}
130138

131139
.repository-with-sidebar.with-full-navigation .repository-sidebar {
@@ -247,12 +255,10 @@ td,th {
247255
}
248256

249257
.markdown-body hr:before {
250-
display: table;
251258
content: "";
252259
}
253260

254261
.markdown-body hr:after {
255-
display: table;
256262
clear: both;
257263
content: "";
258264
}

index.html

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<style>
1111
.markdown-body {
1212
min-width: 200px;
13-
max-width: 790px;
1413
margin: 0 auto;
1514
padding: 30px;
1615
}
@@ -70,16 +69,23 @@
7069
</script>
7170
</head>
7271
<body>
73-
<div class="wrapper">
74-
<div class="container">
72+
<div class="container">
73+
<div class="item row1"></div>
74+
<div class="item row1"></div>
75+
<div class="item row2"></div>
76+
<div class="item row2">
7577
<div class="repository-with-sidebar repo-container new-discussion-timeline with-full-navigation">
76-
<div id="js-repo-pjax-container" class="repository-content context-loader-container">
77-
<div id="readme" class="boxed-group flush clearfix announce instapaper_body md">
78-
<article class="markdown-body"></article>
79-
</div>
80-
</div>
81-
</div>
78+
<div id="js-repo-pjax-container" class="repository-content context-loader-container">
79+
<div id="readme" class="boxed-group flush clearfix announce instapaper_body md">
80+
<article class="markdown-body"></article>
81+
</div>
82+
</div>
83+
</div>
8284
</div>
85+
<div class="item row2"></div>
86+
<div class="item row3"></div>
87+
<div class="item row3"></div>
88+
<div class="item row3"></div>
8389
</div>
8490
<div id="con-error" style="display:none">Live preview is unavailable</div>
8591
</body>

0 commit comments

Comments
 (0)