CSS Styling - gtbu/Typesetter5.2 GitHub Wiki
The Typesetter CMS includes CSS3 themes and various Bootstrap themes. Of course, other CSS frameworks also work. A Bootstrap-offline-documentation is Github.
Css styling happens within the styles.css (.scss, .less) in the template folder (/themes/template-name or /data/_themes/template-name) or in the layout - editor in the right top corner of the single site(custom.css, which is added automatic).
You can follow the loading of the CSS-files and the generated code in the debugger of the browser (right mousekey : klick at element on the page -> inspect) . If You want to see the areas, you can temporarly add
* {
outline: 1px solid red;
}
to the top of the stylesheet
-
As Typesetter has inbuilt compilers for LESS and SCSS, the stylesheet-format can be css ,less or scss, which are automatic chosen.
-
If You want to style a leave (' li ') in the pagemanger, You have the possibility to add classes to each individual ' li - Element ' : The menu - point : Menu Output - classes allows to add custom - classes to each li. You can so for example add icons like li.custom1::before {...}.
-
More mixins (untested with Typesetter)
Typesetter defines a Grid with gpRow and gpCol in incluse/css/additional.css
- Adaption for Bootstrap 4 // convert Typesetter grid in scss to become Bootstrap 4 (flex) grid (as in Bootswatch Themes)
.gpRow { @extend .row; }
.gpCol-1 { @extend .col-md-1; }
.gpCol-2 { @extend .col-md-2; }
.gpCol-3 { @extend .col-md-3; }
.gpCol-4 { @extend .col-md-4; }
.gpCol-5 { @extend .col-md-5; }
.gpCol-6 { @extend .col-md-6; }
.gpCol-7 { @extend .col-md-7; }
.gpCol-8 { @extend .col-md-8; }
.gpCol-9 { @extend .col-md-9; }
.gpCol-10 { @extend .col-md-10; }
.gpCol-11 { @extend .col-md-11; }
.gpCol-12 { @extend .col-12; }
[class *= "gpCol-"] { margin-bottom: unset; }
// fixes for flex grid
.filetype-wrapper_section.row {
> .gpclear {
display: none;
} &:after{
content: none;
For Bootstrap 5.3, the grid logic remains virtually the same: .row and .col-md-* still exist. Consequently, your code will work with almost no changes; however, you can generally remove any fixes intended for the old float/clear behavior, as Bootstrap 5 no longer handles columns using floats or the ::before/::after clearing technique.
// Typesetter grid -> Bootstrap 5.3 grid
.gpRow {
@extend .row;
}
.gpCol-1 { @extend .col-md-1; }
.gpCol-2 { @extend .col-md-2; }
.gpCol-3 { @extend .col-md-3; }
.gpCol-4 { @extend .col-md-4; }
.gpCol-5 { @extend .col-md-5; }
.gpCol-6 { @extend .col-md-6; }
.gpCol-7 { @extend .col-md-7; }
.gpCol-8 { @extend .col-md-8; }
.gpCol-9 { @extend .col-md-9; }
.gpCol-10 { @extend .col-md-10; }
.gpCol-11 { @extend .col-md-11; }
.gpCol-12 { @extend .col-12; }
[class*="gpCol-"] {
margin-bottom: unset;
}
// If Typesetter continues to generate .gpclear elements or ::after clears,
// you can optionally keep these fixes:
.filetype-wrapper_section.row {
> .gpclear {
display: none;
}
&::after {
content: none;
}
}
** What’s changing
.gpRow continues to map to .row; Bootstrap 5.3 still uses Flexbox for this.
.col-md-1 through .col-md-11 remain valid in Bootstrap 5.3; .col-12 represents full width across all breakpoints.
margin-bottom: unset is not a Bootstrap issue, but rather a reset for Typesetter styles; it can remain if your theme requires it.
-- Important note regarding @extend
@extend .col-md-4 only works if the Bootstrap Sass is loaded or imported before your theme’s SCSS, and the class is available within the same Sass compilation. If you are using the precompiled Bootstrap CSS instead, @extend will trigger a Sass error because .col-md-4 does not exist there as a Sass selector.
In that case, it is better to use a CSS variable or a direct declaration:
.gpRow {
display: flex;
flex-wrap: wrap;
margin-right: -0.75rem;
margin-left: -0.75rem;
}
@for $i from 1 through 11 {
.gpCol-#{$i} {
flex: 0 0 auto;
width: percentage($i / 12);
padding-right: 0.75rem;
padding-left: 0.75rem;
}
}
.gpCol-12 {
flex: 0 0 auto;
width: 100%;
padding-right: 0.75rem;
padding-left: 0.75rem;
}
[class*="gpCol-"] {
margin-bottom: unset;
}
This corresponds to the standard 5.3 grid with a total spacing of 1.5rem between the columns; Bootstrap implements this spacing as horizontal padding on the columns and compensates for it on the .row element using negative margins.
If you do not want any spacing:
In the second variant, replace 0.75rem with 0 and the negative row margins with 0. In Bootstrap 5.3, this is equivalent to what was previously .no-gutters and is now .g-0.
** Using Bootstrap Sass mixins
If you include Bootstrap 5.3 as SCSS, use the official grid mixins:
// Typesetter grid -> Bootstrap 5.3 grid
.gpRow {
@include make-row();
}
// Spalten ab md aufwärts
@for $i from 1 through 11 {
.gpCol-#{$i} {
@include make-col-ready();
@include media-breakpoint-up(md) {
@include make-col($i);
}
}
}
.gpCol-12 {
@include make-col-ready();
@include make-col(12);
}
[class*="gpCol-"] {
margin-bottom: unset;
}
make-row() creates the flex-row behavior, make-col-ready() establishes the column box model—including gutters—and make-col($i) defines the width, ranging from 1 to 12 grid units.
Without Bootstrap Sass
If Bootstrap is loaded only as precompiled CSS, you can still achieve this using standard SCSS/CSS. The following example uses the same default gutters as Bootstrap 5.3: 1.5rem horizontally, which translates to 0.75rem of padding per column.
.gpRow {
display: flex;
flex-wrap: wrap;
margin-right: -0.75rem;
margin-left: -0.75rem;
}
@for $i from 1 through 11 {
.gpCol-#{$i} {
flex: 0 0 auto;
width: percentage($i / 12);
padding-right: 0.75rem;
padding-left: 0.75rem;
}
}
.gpCol-12 {
flex: 0 0 auto;
width: 100%;
padding-right: 0.75rem;
padding-left: 0.75rem;
}
[class*="gpCol-"] {
margin-bottom: unset;
}
// Typesetter-Clears ausblenden
.filetype-wrapper_section.row {
> .gpclear {
display: none;
}
&::after {
content: none;
}
}
Responsive Behavior
The version above is "md-first": the columns only take effect from the Bootstrap md breakpoint (starting at 768px by default). Below that, they stack because they do not yet have a fixed width.
If you want to replicate this behavior exactly, use a media query:
@for $i from 1 through 11 {
.gpCol-#{$i} {
flex: 0 0 auto;
width: percentage($i / 12);
padding-right: 0.75rem;
padding-left: 0.75rem;
}
}
For true Bootstrap behavior, however, the width should only be applied starting at min-width: 768px:
@for $i from 1 through 11 {
.gpCol-#{$i} {
padding-right: 0.75rem;
padding-left: 0.75rem;
@media (min-width: 768px) {
flex: 0 0 auto;
width: percentage($i / 12);
}
}
}
.gpCol-12 {
width: 100%;
padding-right: 0.75rem;
padding-left: 0.75rem;
}
Recommendation
*Bootstrap available as SCSS: Use the mixin approach; it remains the most reliable option when updating Bootstrap.
*Bootstrap available only as CSS: Use the standard CSS/SCSS approach.
- No horizontal spacing desired: Set all 0.75rem paddings and the negative .gpRow margins to 0; this is functionally equivalent to Bootstrap’s g-0.
- Responsive standard Css-grid
- a flexbox - solution
- a small css- library with a grid inside