Active
Project:
BS Base
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2017 at 14:58 UTC
Updated:
15 Jun 2021 at 06:56 UTC
Jump to comment: Most recent, Most recent file
In bs_base/themes/bs_bootstrap/sass/theme/base/_elements.scss we have very weak try to implement some kind of proper typography. It kind a work for limited amount of elements, plus its totally not scalable or maintainable. We need something much better and ideally we should use some SASS typography framework for this.
We have couple of options. https://github.com/Famolus/awesome-sass#typography lists 4 frameworks that we can use. Also zen theme is using https://github.com/jptaranto/typey.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | implement_proper-2870726-11.patch | 30.42 KB | njagojevic |
| #11 | interdiff-2870726-4-11.txt | 29.47 KB | njagojevic |
| #8 | implement_proper-2870726-8.patch | 83.07 KB | njagojevic |
| #8 | interdiff-2870726-7-8.txt | 577 bytes | njagojevic |
| #7 | implement_proper-2870726-7.patch | 83.08 KB | njagojevic |
Comments
Comment #2
njagojevic commentedImplemented Typey typography framework. Implemented on common base elements in sass/theme/base/elements. Maybe we should add something more there?
Thoughts?
Comment #3
njagojevic commentedFixed some coding standards.
Comment #4
njagojevic commentedFixed typo. Don't use patch in #3 comment.
Comment #5
thenchev commentedThis looks like the implementation in zen. Works on my end.
For a better review we need someone experienced @pivica :)
Comment #6
pivica commentedOkey here is the first review of code. Still didn't install this to check how it actually look, for now this is just a patch code review.
Beside specific points couple of general questions:
I don't like seeing this comments in our CSS compiled files. Its fine that they are in sources and sass files but not in compiled files. Can we remove them somehow?
This looks wrong, what are this text-bg, text and mark-bg strings in CSS? Maybe sass is missing $ sign for this vars or something else?
All this rules in this files came from where, are they recommended start rules for typey or is this our custom rules?
BS _reboot.scss is doing
html { box-sizing: border-box; } *, *::before, *::after { box-sizing: inherit; }Are you sure we need this also?
Is it possible to use unprefixed text-size-adjust and then let autoprefixer to generate prefixed rules?
Hmmm not sure about this assumption or at least that this should be in base theme.
Also how is this related to typography?
Yeah here are the missing $ stuff.
Why not just one rule here?
Maybe use some vertical grid generator here or its fine that this is fixed?
This %h1 is for what exactly?
I think indentation should be two spaces here.
Two spaces indentation.
Comment #7
njagojevic commentedGenerally all mentioned framework are pretty much the same. I found typey more useful as it has some more variables and features for customization compared to others.
Added link to Typey documentation in BS Base readme file and added better description for typey in sass files.
What is the best solution for this?
1. This comments are coming from imported typey library. I couldn't find how to fix this. Do you have any suggestion?
2. I removed this color options as they are already styled with
reboot.scssandnormalize.scss.3. Added description for Typey vertical rhythm rules.
4. Removed the first part.
is from
reboot.scss.6. Removed all things that aren't related to typography, as well as this one.
9.
Any suggestion here.
10. Changed
%h1to.h1for all headings.All other suggestions are applied in this patch.
Comment #8
njagojevic commentedFixed forgotten indentation.
Comment #9
pivica commentedPlease check latest patch because lots of stuff is removed which are not related to vertical grid support - check some comments bellow - i guess this is an error.
> 1. This comments are coming from imported typey library. I couldn't find how to fix this. Do you have any suggestion?
We can do this easily in gulp process. We don't want to remove all comments but just this boring repeating stuff - something like some plugin (maybe we already have it) that will search&replace and then kill this comments in compiled CSS.
> 9.
>
> Maybe use some vertical grid generator here or its fine that this is fixed?
> Any suggestion here.
No, then i would need to learn how typey works ;) I am just asking can we apply something from typey so this component follows vertical grid?
If implementation in bs_bootstrap then the documentation should be also in bs_bootstrap/README.md.
However it make sense to promote this in bs_base because vertical grid framework is not related to BS. Can we maybe move this to bs_base somehow and then reuse it in bs_bootstrap?
Why is this removed?
Removed why?
Yeah pretty confused with this removes?
This should not be in _bs_bootstrap.scss but in separated sass variable file called _typey.scss for exmaple
More strage removes?
Comment #10
pivica commented> What is the best solution for this?
Yeah just decouple stuff in sass so you don't hard bundle typey with other stuff but you keep stuff separated. Then child themes can easily override or remove this stuff in sass compilation. Also keep typey sass vars separated - there is a comment in previous comment about that.
Comment #11
njagojevic commentedThis patch has interdiff file with differences between comments #4 and #11. Please don't consider patch in comment #8 as there were wrong removes.
In this patch were applied all suggestions from comment #6 and next suggestions form comment #9 and #10:
- typey implementation moved from BS Bootstrap to BS Base,
- added css strip option to gulp that strips important comments in compiled css,
- typey sass stuff is now decoupled - sass variables in different .scss file,
- for sub and sup elements changed units to rem.
Comment #12
njagojevic commentedComment #13
pivica commentedComment #14
candelas commentedVertical rhythm with Bootstrap 4. Really interesting to get it. Thanks :)
Comment #15
pivica commentedComment #16
pivica commentedNice article discussing vertical rhythm implementation https://www.lullabot.com/articles/designing-rhythm-and-proportion.
Comment #17
pivica commentedComment #18
pivica commentedJust figure it out that latest Bootstrap is using new rfs library for responsive fonts https://github.com/twbs/rfs. We should switch using this.
Comment #19
pivica commented