Coder Social home page Coder Social logo

jdan / 98.css Goto Github PK

View Code? Open in Web Editor NEW
9.0K 60.0 299.0 712 KB

A design system for building faithful recreations of old UIs

Home Page: https://jdan.github.io/98.css

License: MIT License

CSS 89.95% JavaScript 10.05%
css design-system windows98 guy-fieri

98.css's Introduction

98.css

npm gzip size

A design system for building faithful recreations of old UIs.

a screenshot of a window with the title 'My First VB4 Program' and two buttons OK and Cancel, styled like a Windows 98 dialog a magnified view showing pixel-perfect borders on a scrollbar and button element

98.css is a CSS file that takes semantic HTML and makes it look pretty. It does not ship with any JavaScript, so it is compatible with your frontend framework of choice.

Be sure to check out XP.css and 7.css as well.

Installation / Usage

The easiest way to use 98.css is to import it from unpkg.

<!DOCTYPE html>
<html>
<head>
  <title>98.css example</title>
  <meta charset="UTF-8" />
  <link rel="stylesheet" href="https://unpkg.com/98.css" />
</head>

<body>
  <div class="window" style="margin: 32px; width: 250px">
    <div class="title-bar">
      <div class="title-bar-text">
        My First VB4 Program
      </div>
    </div>
    <div class="window-body">
      <p>Hello, world!</p>
    </div>
  </div>
</body>
</html>

Alternatively, you can grab 98.css for the releases page or npm.

npm install 98.css

Here is an example of 98.css being used with React, and an example with vanilla JavaScript.

Refer to the documentation page for specific instructions on this library's components.

Developing

First, run npm install.

style.css is where everything happens.

You can use npm start to start a development environment that will watch for file changes and rebuild 98.css, reloading your browser in the process.

You can run a build manually with npm run build. This will write to the dist/ directory.

Issues, Contributing, etc.

Refer to the GitHub issues page to see bugs in my CSS or report new ones. I'd really like to see your pull requests (especially those new to open-source!) and will happily provide code review. 98.css is a fun, silly project and I'd like to make it a fun place to build your open-source muscle.

Thank you for checking my little project out, I hope it brought you some joy today. Consider starring/following along on GitHub and maybe subscribing to more fun things on my twitter. ๐Ÿ‘‹

Publishing

Building the docs site: npm run deploy:docs

Publishing to npm: npm run release

License

MIT

98.css's People

Contributors

agustinl avatar andreymazepas avatar captainfalcon92 avatar creeppork avatar dependabot[bot] avatar drdator avatar dsgibbons avatar dwhinham avatar husano896 avatar isiah-lloyd avatar jacob-macleod avatar jdan avatar joaonunomota avatar juanigaray avatar kaytwo avatar loama avatar lwkchan avatar mattbegent avatar modernserf avatar mpopv avatar muan avatar n055 avatar nemo369 avatar neverage avatar pedrobonifacio avatar rbstrachan avatar robert-ryu7 avatar teodragovic avatar vtlanglois avatar xheinrich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

98.css's Issues

Dropdown menu doesn't render correctly

Reference screenshot found online:

image

Current dropdown in latest Edge Dev (Chromium):

image

Also the hover state doesn't seem right.

EDIT: This may be a limitation of using a native select component.

Trigger a build commit on push to master

Set up Travis CI so that when commits are pushed to the master branch, the project is built and the result is pushed back to master. This should make pull request diffs easier to read and it will prevent branches from being polluted with "Build project" commits every time a change is requested.

Inauthentic rendering of top/left window borders

Hi. The Chicago rendering theme introduced in Windows 95 actually has a fairly prominent mistake in it that your recreation is missing; specifically, window borders (and only window borders) have the "Light" and "Hilight" colours swapped. I've attached some comparative screenshots for reference. You can check ToastyTech for more exact metrics, e.g. fixing the padding on the window caption text and the caption bar context buttons.

98css

Pressed button text position

On a Windows machine (98 style), the button text actually shifts down and right a pixel, contributing to the 'pressed' look and feel.

I have a fix for this but don't have contributor access to submit a PR for review. It was...surprisingly finicky to get right cross-browser.

What's the common wisdom on build/ + checking in builds?

As many of you noticed, build/98.css and docs/98.css are checked in. docs/ powers https://jdan.github.io/98.css, and build/ allows folks to use 98.css via https://unpkg.com/98.css

However, these are annoying to deal with in PRs! They're minified so we get conflicts on pretty much every commit. I used to have an npm test (+ travis integration) to make sure people ran npm run build, but I've just removed that. I'm starting to think we don't want any PRs to include build/98.css or docs/98.css.

Any ideas for making this more pleasant?

Table component

It would be awesome to have some kind of table component.

Keep it up, this looks awesome!!! ๐ŸŽ‰

Text is too smooth

Text is beautiful, smooth, and readable. I don't wish I had bought a Mac when I read it. Should be jagged.

Titlebar gradient should not extend the full width

According to the high-quality screenshots in the GUIdebook gallery, the titlebar gradient should not span the entire width of the titlebar, but only the title portion. The window icon has a solid background (ActiveTitle, InactiveTitle), and the window controls have a solid background (GradientActiveTitle, GradientInactiveTitle).

Display Properties
WordPad


If you would like to use it as a reference, I attempted to make a faithful recreation myself a few years ago for a Windows theme creator and I believe I the colour mapping to the various elements are correct. The repo is tpenguinltg/winclassic (demo). You can load the Windows 98 values into the box to see it live.

Not deploying, error in build/98.css

When attempting to deploy my app made with React with 98.css, it presents an error message:

./node_modules/98.css/build/98.css
ParserError: Syntax Error at line: 1, column 6
at Array.forEach ()
at Array.forEach ()

and refuses to compile! Reinstalling 98.css with npm and updating the packages along with reconfiguring my packages.json(https://blog.usejournal.com/how-to-deploy-your-react-app-into-github-pages-b2c96292b18e) does not aid the problem. This has been a consistent issue I have been encountering and is preventing me from further developing my personal website.

border-style inset/outset

Hi,

I saw this posted on Hacker News and I was wondering why you use box-shadow for the "3D effect" on buttons and window borders instead of border-style: outset. Is there a technical reason for it?

I think the box-shadow version makes it look a bit softer than it was in Windows 98.

support for `readonly`

There's support for the disabled attribute, but I don't see support for the readonly.

They look the same, but behave differently. The disabled inputs don't present in the POST data, while the readonly ones do.

Missing BSOD

Missing styles for a BSOD. I recall seeing that quite a bit back in the day.

Window title bar dimensions seem to be incorrect

It appears that the buttons on the title bar and the borders are not quite the same as on actual Windows 98.

Please compare (grey background is 98.css, teal is Windows 98):
image - 98.css
image - Windows 98
image - overlaid and centered on the top right corner
image - centered on the close button

Border of groupboxes

GroupBoxes are 2 colored (white and dark gray) in w98, however the css has them colored in 4 colors (black, d gray, b gray, white)
example in windows 98:
image
css:
image

Theme support

I'd love color theme support. Custom colors were a wonderful way to personalize your os.

Labels for checkboxes and radio buttons should not be selectable

I may be mistaken, but clicking and dragging on labels of a checkbox shouldn't highlight the selected text in blue. If this is the case, and it wouldn't negatively hamper a11y to do so, it seems like the fix is: https://stackoverflow.com/questions/924916/is-there-a-way-to-make-a-div-unselectable?

image

Feel free to close this issue if either of my two assumptions above (98 components have un-selectable checkbox/radio labels, and making it unselectable wouldn't damage accessibility somehow) is false, but this was just a thought. I'm happy to take this on myself if nobody else grabs it.

Selecting Label Text

Couldn't find a position on this, so I figured I'd mention it here.

Traditionally on Windows platforms (Including Windows 98), labels (and legends, window title bars, etc) cannot have their text selected. Modern systems allow you to double-click labels to copy their text however.

As accessibility is a priority, I'd recommend considering the ramifications of this. With my experience with assistive technology, you should still be able to read those out, even with text selection disallowed.

Another option may be able to have a utility class that explicitly allows for selection (Or a custom data attribute) but there doesn't seem to be much of that in this project so far.

Either way, I thought it'd be good to discuss!

Should disabled buttons be clickable?

On the https://jdan.github.io/98.css/ page, "disabled" buttons still can be "clicked" - they show their :active state.

I checked The Windows Interface Guidelines for Software Design (p. 381-382 for information on unavailable appearance for buttons), but it does not specifically say what the correct behavior is. Still, it seems like it will be more logical for a disabled button to not be "clickable" - especially as it will not perform any action.

Button text should move when button is pressed

I don't have a copy of Windows 98 handy to check and capture a video of this in action (or any versions of Windows, for that matter), but the behaviour of Windows Classic on newer versions of Windows is that the text of a button moves when the button is in a depressed state. I don't expect this to have been different in Windows 98.

According to my theme designer, the text moves 1px down and 1px right from its normal position.

Needs custom cursors

I think the cursor/mouse pointer used to change when hovering over certain things...
(TBH I can't remember exactly)

Font does not match 8pt Tahoma

I see there's a letter-spacing: -0.03ch. I'm not sure if that's what you were going for:

image

(this is Firefox on Windows 10)

I think that because Windows uses pretty aggressive hinting, the spaces between letters become more uneven, sometimes snapping to 1 pixel and sometimes to 2 pixels. I can only speak for myself but the end result looks... broken.

Maybe using another, narrower font would have a better effect than this tweak?

Now that I think of it, turning off ligatures could also help: some of the "tt", "ti" and so on look like a big part of the problem.

Great project, by the way :)

Tab Control Missing

The stylesheet lacks the Tab control. It's quite intricate in implementation, especially when rows are involved.

Problem with tree view.

I have a trree view in a field-row.
Found that the first

  • -item was ok but the rest had space in front after the binding line.
    I think they inherited margin-left from the field-row.

    So I added

    ul.tree-view ul,
    ul.tree-view li {
    margin-top: 3px;
    margin-left: 0px;
    }

    to the 98.css

    Since I'm no css guru, I'm not shure this is the right solution, but it solved my problem.

  • Border for images or other components

    I'm not sure what to call this, but some windows would have an inset border for images or other components, similar to text areas. Here are a couple screenshots:

    The test area in the bottom right:
    image

    The image in the window behind the menus:
    image

    This inset border is used for most windows that contain other items, like the file explorer or browser (also seen in the second image). Note that this is different from the Group Box border. It's actually the inverse of the regular window border; the highlight is bottom-right and shadow is top-left, since it's inset.

    Progressbar missing

    The stylesheet looks amazing, but it still lacks the ProgressBar control.
    It would be nice to see it added.

    Start Menu Component

    It would be nice to have the start menu recreated so it can be used as a navbar.

    Semantic elements

    I've seen windows are created with div elements, wouldn't it be better to user header, article, footer and other similar ones to identify each section?

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.