This lab bundles a number of CSS-related tools for Web design.
CSS3 FlexBoxes can be use to implement responsive design.
Implement a responsive webpage similar to the one shown on the right using the code found in this tutorial: Using CSS Flexible Boxes*. The responsive styles in the example occur automatically as the browser frame is resized. Implement the following changes to the original example.
Feel free to experiment with the responsive layout. When you’ve got things running, consider the following questions.
Save the resulting files for the next exercise.
Stylus is a CSS pre-processor based on Node.js (see Stylus-lang.com).
Use Stylus to refactor the previous example, without changing the content or style of the original.
Rename the style.css
script to
style.styl
. This will now
serve as the input to the Stylus CSS pre-processor.
Use Stylus to pre-compile this file into the expected style.css
as
follows.
stylus pathToFiles/style.styl
--out
pathToFiles/.
Now, view the main HTML file in a browser to ensure that nothing has changed.
Modify the .styl source file in the following ways in order to achieve DRY goals. Base your work on the instructions given at Sylus-lang.com under the following headings:
Feel free to experiment with other Stylus features. Mixins and functions are particularly useful and the nib library adds CSS3 features.
--watch
and the --compress
options to the
Stylus command.
When you have these changes made and have ensured that the content and style have remained unchanged, consider the following questions.
--watch
and the
--compress
options do and
why would you want to use them?
Save the updated files for submission. Save your answers to these
questions in a lab05.txt
file in the root of your lab repo.
We will grade your work according to the following criteria:
*MDN replaced their original tutorial (archived here by the Wayback Machine) with this new version. The new and old versions are similar in content, but the new one no longer discusses the header-body-footer example used in this lab.