Preface
Goal: Focusing on content page.
Especially the panel.
1: Content
It is very similar as the previous one, with just a few CSS adjustment.
The Sylesheet: Content
-
- tutor-06/sass/css-61/_post.sass
- gitlab.com/…/sass/css-61/_post.sass.
.blog-post
margin-bottom: 1rem
.blog-post-title
margin-bottom: .25rem
font-size: 2.5rem
.blog-post-meta
margin-bottom: 1.25rem
.blog-post p
margin-top: 0.5rem
margin-bottom: 0.5rem
The Main Stylesheet
Again, consider make the main
sass a line longer.
-
- tutor-06/sass/css-61/main.sass.
- gitlab.com/…/sass/css-61/main.sass.
...
@import "blog"
@import "panel"
@import "list"
@import "post"
Always recompile the CSS.
$ dart-sass --watch -I sass sass/css-61:css/
Compiled sass/css-61/main.sass to css/main.css.
Sass is watching for changes. Press Ctrl-C to stop.
The Document: Example Code
And also very few adjustment, by adding the blog-post
class.
-
- tutor-06/61-post-content.html
- gitlab.com/…/61-post-content.html.
<main role="main"
class="column is-two-thirds blog-column box-deco has-background-white">
<div class="blog-post" itemscope itemtype="http://schema.org/BlogPosting">
<article class="main-content" itemprop="articleBody">
<h4 class="title is-4">Letters to my Bulma</h4>
<p>There are so many things to say
to Bulma, Chici, and that Android 18.
I don't want to live in regrets.
So I wrote this for my love.</p>
</article>
</div>
</main>
The Preview
You can see, the not so different look as below:
2: Header
This takes a very few SASS line, but a long hypertext document.
The Sylesheet: Content
-
- tutor-06/sass/css-62/_post-header.sass
- gitlab.com/…/sass/css-62/_post-header.sass.
.main_title
background: rgba(256, 256, 256, 0.5)
a
color: $primary
a:hover
color: $gray
We also need to adjust this $primary
color to match the brand logo:
It is time to add _initial-variables
.
-
- tutor-06/sass/css-62/_initial-variables.sass.
- gitlab.com/…/sass/css-62/_initial-variables.sass
// Initial Variables
$brand-red: #802020
$brand-gray: #404040
$gray: #7b8a8b
$yellow: #f7d316
$blue: #2980b9
$dark: $brand-red
$primary: $brand-gray
$navbar-breakpoint: 769px
The Main Stylesheet
Again, consider make the main
sass a line longer.
-
- tutor-06/sass/css-62/main.sass.
- gitlab.com/…/sass/css-62/main.sass.
...
@import "post"
@import "post-header"
Always recompile the CSS.
$ dart-sass --watch -I sass sass/css-62:css/
Compiled sass/css-62/main.sass to css/main.css.
Sass is watching for changes. Press Ctrl-C to stop.
The Document: Example Code
-
- tutor-06/62-post-header.html
- gitlab.com/…/62-post-header.html.
As I promise, a longer document line. It is basically just tags.
<main role="main"
class="column is-two-thirds blog-column box-deco has-background-white">
<div class="blog-post" itemscope itemtype="http://schema.org/BlogPosting">
<section class="box">
<div class="main_title">
<h4 class="title is-4 blog-post-title" itemprop="name headline">
<a href="#">Letters to my Bulma</a></h4>
</div>
<div class="is-clearfix"></div>
<div class="field">
<div class="is-pulled-left">
<span class="meta_author tag is-primary is-small">
<span class="fa fa-user"></span>
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">epsi</span></span>
</span>
</div>
<div class="is-pulled-left">
<span class="meta-time tag is-light is-small">
A few days ago.
</span>
</div>
<div class="is-pulled-right">
<a href="#">
<span class="tag is-light is-small"><span class="fa fa-tag"></span> love</span></a>
</div>
<div class="is-pulled-right">
<a href="#">
<span class="tag is-dark is-small"><span class="fa fa-folder"></span> rock</span></a>
</div>
</div>
<div class="is-clearfix"></div>
</section>
<article class="main-content" itemprop="articleBody">
<p>There are so many things to say
to Bulma, Chici, and that Android 18.
I don't want to live in regrets.
So I wrote this for my love.</p>
</article>
</div>
</main>
The Preview
Consider have a look at the preview from your favorite web browser.
3: Navigation
This content page will be better if we can give navigation. We’re almost done with this content.
The Sylesheet: Content
-
- tutor-06/sass/css-63/_post-navigation.sass
- gitlab.com/…/sass/css-63/_post-navigation.sass.
a.post-previous:after
content: " previous"
a.post-next:before
content: "next "
The Main Stylesheet
Again, consider make the main
sass a line longer.
-
- tutor-06/sass/css-63/main.sass.
- gitlab.com/…/sass/css-63/main.sass.
...
@import "post"
@import "post-header"
@import "post-navigation"
Always recompile the CSS.
$ dart-sass --watch -I sass sass/css-63:css/
Compiled sass/css-63/main.sass to css/main.css.
Sass is watching for changes. Press Ctrl-C to stop.
The Document: Example Code
-
- tutor-06/63-post-navigation.html
- gitlab.com/…/63-post-navigation.html.
<main role="main"
class="column is-two-thirds blog-column box-deco has-background-white">
<div class="blog-post" itemscope itemtype="http://schema.org/BlogPosting">
<section class="box">
...
</section>
<article class="main-content" itemprop="articleBody">
<p>There are so many things to say
to Bulma, Chici, and that Android 18.
I don't want to live in regrets.
So I wrote this for my love.</p>
</article>
<br/>
<nav class="pagination is-centered"
role="navigation" aria-label="pagination">
<a href="#" class="pagination-previous post-previous"
title="next article name">« </a>
<a href="#" class="pagination-next post-next"
title="previous article name"> »</a>
</nav>
</div>
</main>
The Preview
Consider open from file manager, so you can examine in your favorite web browser.
This actually in 480px, or you can say under mobile
breakpoint.
4: Summary
As a summary, consider to see the page again in 800px,
or you can say under desktop
breakpoint.
What is Next ?
We are not finished yet with SASS in Bulma. There are still issues we have to face in real world website stylesheet. Consider continue reading [ Bulma SASS - Helpers ].
Thank you for reading.