Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HGHOST-191: Migrate Stylesheets from SCSS to LESS #228

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
THEME_PATH := $(CURDIR)
DEV_GHOST_PATH := '/Users/toddbirchard/projects/ghostlocal'
DEV_GHOST_THEME_PATH := '/Users/toddbirchard/projects/ghostlocal/content/themes/hackersandslackers-theme'
DEV_GHOST_PATH := '/Users/toddbirchard/Projects/ghostlocal'
DEV_GHOST_THEME_PATH := '/Users/toddbirchard/Projects/ghostlocal/content/themes/hackersandslackers'

define HELP
Manage development of Hackersandslackers Ghost theme.
Expand Down Expand Up @@ -31,7 +31,7 @@ build:
dev:
if [ -d $(DEV_GHOST_THEME_PATH) ]; then rm -rf $(DEV_GHOST_THEME_PATH); fi
cp -R $(THEME_PATH) $(DEV_GHOST_THEME_PATH) && \
cd $(DEV_GHOST_THEME_PATH) && npm run dev && \
cd $(DEV_GHOST_THEME_PATH) && yarn run dev && \
cd $(DEV_GHOST_PATH) && ghost restart --verbose && cd $(THEME_PATH)


Expand All @@ -51,7 +51,8 @@ clean:
.PHONY: update
update:
npm install -g npm@latest && \
npm install -g npm-check-updates@latest && \
npm install -g yarn && \
npm install -g ghost-cli@latest && \
npm install -g npm-check-updates@latest && \
cd $(DEV_GHOST_PATH) && ghost update && \
cd $(DEV_GHOST_THEME_PATH) && ncu
112 changes: 110 additions & 2 deletions assets/built/fonts.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/built/hamburgers.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/page.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/post.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ iframe.instagram-media+script+ :not([id]) {
margin: 20px auto;
max-width: 100%;

@media(max-width: $mobile-breakpoint) {
@media(max-width: 600px) {
padding: 0 30px;
}
}
Expand Down
6 changes: 3 additions & 3 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"go",
"hcl",
"vim",
"makefile",
"makefile"
],
"theme": "default",
"css": false
Expand All @@ -49,8 +49,8 @@
{
"root": ["./src"],
"alias": {
"Fonts": "./assets/fonts/",
"Styles": "./src/scss/"
"Fonts": "./src/css/fonts.css",
"Styles": "./src/less/"
}
}
]
Expand Down
6 changes: 4 additions & 2 deletions default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
<link rel="preload" as="style" href="{{asset "built/global.css"}}">
<link rel="preload" as="script" href="{{asset "built/main.js"}}">
{{!-- Theme CSS --}}
<link rel="stylesheet" type="text/css" href="{{asset 'built/fonts.css'}}" />
<link rel="stylesheet" type="text/css" href="{{asset 'built/global.css'}}" />
<link rel="stylesheet" type="text/css" href="{{asset 'built//hamburgers.min.css'}}" />
{{!-- Custom Theme JS --}}
<script src="{{asset 'built/github-widget.js'}}"></script>
<script src="https://kit.fontawesome.com/0dae50f8a6.js" crossorigin="anonymous"></script>
{{!-- Analytics JS --}}
<script defer data-domain="hackersandslackers.com" src="https://plausible.io/js/script.outbound-links.pageview-props.tagged-events.js"></script>
<script>window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
{{!-- <script defer data-domain="hackersandslackers.com" src="https://plausible.io/js/script.outbound-links.pageview-props.tagged-events.js"></script>
<script>window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments) }</script> --}}
{{!-- Page-specific JS --}}
{{#is "post"}}
<script src="{{asset 'built/post.js'}}"></script>
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@tryghost/release-utils": "0.8.1",
"babel-plugin-prismjs": "^2.1.0",
"basiclightbox": "^5.0.4",
"delicious-hamburgers": "^1.2.3",
"dotenv": "^16.4.5",
"dotenv-webpack": "^8.1.0",
"github-profile-card": "^3.1.0",
Expand All @@ -68,13 +67,13 @@
"cssnano": "7.0.6",
"font-config-webpack-plugin": "^2.0.3",
"inquirer": "12.1.0",
"less": "^4.2.1",
"less-loader": "^12.2.0",
"mini-css-extract-plugin": "^2.9.1",
"postcss": "^8.4.47",
"postcss-easy-import": "4.0.0",
"postcss-loader": "^8.1.1",
"pump": "3.0.2",
"sass": "^1.79.3",
"sass-loader": "^16.0.2",
"style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.95.0",
Expand Down
2 changes: 0 additions & 2 deletions src/scss/_fonts.scss → src/css/fonts.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import "../scss/global.scss";
import { mainNavigationScroll, hamburgerMenu } from "./navigation.js";
import "../less/global.less";
import "../css/fonts.css"
//import { mainNavigationScroll, hamburgerMenu } from "./navigation.js";
// import { authorDisplayName } from "./postcard.js";

window.addEventListener("load", function () {
mainNavigationScroll();
hamburgerMenu();
// mainNavigationScroll();
// hamburgerMenu();
// authorDisplayName();
});
5 changes: 4 additions & 1 deletion src/js/navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function mainNavigationScroll() {
/* export function mainNavigationScroll() {
const slider = document.querySelector(".dragscroll");
let isDown = false;
let startX;
Expand Down Expand Up @@ -45,6 +45,7 @@ export function hamburgerMenu() {
mobileMenuButton.classList.toggle("active");
});


mobileSeriesLink.addEventListener("click", function () {
const mobileSeriesNav = document.querySelector(
".nav-series .mobile-nav-links-list"
Expand All @@ -60,4 +61,6 @@ export function hamburgerMenu() {
mobileTagNav.classList.toggle("active");
mobileTagsNavIcon.classList.toggle("flip-vertically");
});

}
*/
8 changes: 4 additions & 4 deletions src/js/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "../scss/page.scss";
import "../scss/series-all.scss";
import "../scss/series-detail.scss";
import "../scss/about.scss";
import "../less/page.less";
import "../less/series-all.less";
import "../less/series-detail.less";
import "../less/about.less";

window.addEventListener("load", function () {
fixGithubUrls();
Expand Down
2 changes: 1 addition & 1 deletion src/js/post.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "../scss/post.scss";
import "../less/post.less";
import Prism from "prismjs";
import * as basicLightbox from "basiclightbox";

Expand Down
Loading