Closed jamestagal closed 2 years ago
You could either:
Sass / SCSS is the industry standard these days used in most professional settings and I spent an early part of my career convincing the dev teams I was on to adopt it. That said, I hate it now and avoid it whenever possible. It adds tooling that confuses people (like it's doing in this issue) for little benefit and forces you to write worse (more specific) styling code. I'm probably in the minority with these opinions, but do hold some hope that minimalist development is on the rise in popularity.
The &
sign is a horrible convention that allows you to break up same level classes / attributes to multiple nested lines. This kills the discoverability of your code on large projects because it makes it impossible to grep search simple class names to find source styles. Defenders of this will say that you can easily solve that with... you guessed it, more tooling. The solution in CSS would be to just to put these on a single line for each target.
The @includes
symbol allows you to embed styles within each other. You could just copy all these separate files to one file and add a /* block comment */
to separate the sections.
The $
is for SCSS variables, but you can accomplish the same with the CSS variables: font-family: var(--secondary-font);
. These unfortunately will not work in media queries: https://stackoverflow.com/questions/40722882/css-native-variables-not-working-in-media-queries.
Thanks @jimafisk for that explanation. I would happily join you in that minority point of view. I am a huge advocate of simplicity since I'm from an education background and find making things easy and simple to understand is the best approach. So I think i will try converting it as per your suggestion No2.
Also, I just realised that I forgot to add the link to the global.css
in the head.svelte
. :) that helped.
Question about this Educenter Hugo SCSS file configuration. It is a bit confusing. https://github.com/themefisher/educenter-hugo/tree/master/assets/scss
They have separated styles for each component then most files have underscores _buttons.scss
and to compound the confusion, there is a templates
folder with more files!!!
I think I should just take the approach here to combine all of those separate styles into our global.css
file and convert it from SCSS to CSS?
Sorry another issues I found, not related to above is, when I click into the head.svelte
file I get an error warning that disappears when I click out or close the file.
The error is Cannot find module './transformers/module'
Hi @jimafisk
I am not having much luck with the SCSS converter ! It keeps giving me errors. See file below. https://drive.google.com/file/d/1bEwvHVNQsuq7WckQTEI__hGWOTfGazMF/view?usp=sharing
I am wondering whether I try option 1 now !!
UPDATE: I have been working my way through this SCSS file and trying to modify it using your description above but still have many problems... just wave and smile!! just wave and smile! I pushed my change to the repo. Ben
The way that theme is structured is the main.scss file @includes
all the other files. The underscore is just a convention for an SCSS partial to denote it's meant to be included in another file.
That transformers/module
error is strange, I don't see anything in your <head>
that would throw that. Might be related to: https://github.com/sveltejs/svelte-preprocess/issues/261.
I'm not sure how good that SCSS converter is, I've never actually tried it. The global.css file you sent still has SCSS variables and @includes
in it though, so the browser won't be able to read that as valid CSS. It might take some work to convert that to regular CSS manually. You could just grab the convert CSS from the demo site: https://demo.gethugothemes.com/educenter/site/scss/main.39a92863184ba4ea9990e2082bf7fd67c858263e3dd67f677d1add7a1c5de28ebcc1a01478d007a95bb116ce25df5a23961347c553b8891e649dbc716290c204.css In case that fingerprinted CSS file changes, here's the CSS:
Using SCSS is totally valid if you'd rather! You'll just need to set up a step that compiles the SCSS into regular CSS. There are lots of different ways you can do this: https://sass-lang.com/install
Thank you @jimafisk I appreciate your replies with explanations and help. :) I will continue working on theme over the coming week to try get it completed. Thanks again.
BTW. I noticed you have update the Plenti docs page and it looks really good, very clear and readable! Also just watched your Devlog and it is all coming along great. I will upgrade to 5.11 now.
One thing I wasn't sure if you had wired up yet was the Add
(button) functionality once logged it. When clicking on it nothing happens on my test site https://myplentisite.gitlab.io/my-plenti-site/
Great work Jim.
Ben
Thanks @jamestagal, seems like you're making good progress!
Good catch on the docs updates, it's subtle. There's a bunch of undocumented stuff I still need to add, just trying to make incremental improvements whenever possible.
The add
button should be working, just note that you need to have a _blueprint.json
for each content type for this to work. If that's still giving you trouble after adding that (and defining the default content inside each blueprint) just let me know!
Great... @jimafisk I will have a look at the _blueprint.json files... Also please let me known if I can help with stuff like posting documentation.. happy to help out whenever i can. Cheers Ben
Also please let me known if I can help with stuff like posting documentation.. happy to help out whenever i can.
That would be great honestly, the more resources that are out there, the easier it'll be to onboard folks. You're always welcome to make PRs to the website (https://github.com/plentico/plenti.co), but also if you ever want to post your own blog posts, make videos, tweets, or anything really it all helps. I appreciate all the engagement you already do with the project!
Hello @jimafisk I have make some initial progress with the theme. I started working on the landing page with all sections connected up to the data source but have run into an issue with CSS. I can't get any styling to work.
When I look at the Educenter source code I only find SCSS files Then I started add them to the
global.css
file https://github.com/jamestagal/plenti-educenter/blob/main/assets/global.css and got lots of errors. The issues are as follows:@includes
in many lines I get a warning&:
symbol before something like this, throws an error.Some sub-classes or child classes such as
.play-btn
below throws an error$
sign also in a problem. Something like this:What is the best way to deal with this SCSS and turn it into CSS? When you get a chance please have a look for me.
P.S. I haven't see any Devlog updates recently.. how is everything ? Ben