SASS for DTBooks.
Author: Jukka Eerikäinen 2015 jukka.eerikainen@aalto.fi
dtbook-css is a modular and extensible layout framework for DTBooks. dtbook-css is intended to be used both as the stylesheet for the end product and within the production toolchain.
dtbook-css is compatible with (at least) Oxygen XML editor (especially so when augmented with dtBookTools), Dolphin EasyReader / Internet Explorer 7, and modern WebKit/Gecko/Trident-based browsers. Modern browser support is not widely tested. There is preliminary support for mobile devices, but mobile support is not yet satisfactory.
dtbook-css is meant to be a long-term, one size fits all-type of solution for rapid production of DTBook.
If you're just interested in using the CSS as is, download dtbook.css.
If you want to edit the styles, you can download the project as a zip.
The easiest way for users to build the project is probably with Sublime Text's sass-textmate-bundle.
You can build the project with Notepad++ with jN and Sass-Auto-Compile. See https://deekaysblog.wordpress.com/2012/08/12/notepad-series-3-sass-highlighting-and-auto-compile/ for more info.
- Install Ruby. Download Ruby for Windows and install as Executable in PATH.
- Install SASS. Open Start menu and type
cmdand press enter. Typegem install sassand press enter.
- Install Notepad++.
- Install jN plugin for Notepad++. (Download zip, unzip to Notepad++/plugins/.)
- Copy Sass-Auto-Compile.js to Notepad++/plugins/jN/includes/.
- Configure the script: set pathToRubyBin correctly; set debugMode = false;.
- (Optional but highly recommended.) Configure syntax highlighting. Download http://www.kuenzelit.de/blogContent/sass-user-defined.xml and import in Notepad++
View->User defined language->import.
- Install Sublime Text 2.
- Install Package Control for Sublime Text.
- Install SASS textmate bundle with Package Control. Click
Preferences->Package Control->Install Package-> Typesass-> click onSass. The description text is "Sass support for TextMate & Sublime Text (2 & 3)". - Install SASS Build with Package Control.
- Restart Sublime Text.
- Just save
dtbook.scss.
Note: Notepad++ does not give a confirmation when build is ready. It shouldn't take much longer than around five seconds, though.
- Open
dtbook.scssin Sublime Text. Tools->Buildorctrl + B
This builds the whole project into dtbook.css file in the same folder as dtbook.scss. Old version of dtbook.css is overwritten.
The project is structured modularly. dtbook.scss is the main SASS project file that a) contains namespace declarations and b) imports all other files. globals folder contains a reset sheet, global variable definitions (for example, color scheming, fonts, margin and padding sizes and so on), global mixins (rounded corners) and so on. globals folder has no concrete declarations for any particular elements or classes. oxygen folder contains code required for Oxygen XML Editor author mode. elements folder contains concrete style rules for elements and some reusable templates bound to classes (see for example _laatikko.scss). Note that in concrete style rules the convention is to avoid usage of naked values (e.g. a particular color such as #FFAAAA or manually setting margin: 2em;). All such values shall be defined under globals and then reused by variable name. This helps to keep the code manageable and understandable, reduces code duplication and makes it possible to make big changes fast.
For more detailed information, see HACKING.md file.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.