From 613294624a77d981f25ba16ad94191adde7f7ada Mon Sep 17 00:00:00 2001 From: weeklies <80141759+weeklies@users.noreply.github.com> Date: Fri, 22 Aug 2025 14:16:00 +0000 Subject: [PATCH 1/7] Rewrite load_user_skins * Use File.exist? over removed File.exists? * Add rake tasks to reset_database.sh * Update README * Add support for parent_only skins through a subdirectory * Add support for /* MEDIA: */ and /* MEDIA: ENDMEDIA */ To reduce complexity, the following unused features are removed: * Remove support for /* REPLACE: */ * Remove support for multiple skin declarations using /* END SKIN */ --- app/helpers/application_helper.rb | 2 +- lib/tasks/skin_tasks.rake | 188 +++-- .../site/user_skins_to_load/README.md | 54 ++ .../site/user_skins_to_load/README.txt | 26 - .../site/user_skins_to_load/dark_mode.css | 5 + .../low_vision_default_site_screen_.css | 191 +++++ .../parent_only/dark_mode_midsize_.css | 26 + .../parent_only/dark_mode_site_screen_.css | 792 ++++++++++++++++++ .../parent_only/snow_site_screen_.css | 59 ++ .../previews/default_preview.png | Bin 0 -> 3688 bytes .../reversi_site_screen_.css | 384 +++++++++ .../snow_blue_site_screen_.css | 69 ++ script/reset_database.sh | 2 + spec/lib/tasks/skin_tasks.rake_spec.rb | 41 + 14 files changed, 1720 insertions(+), 119 deletions(-) create mode 100644 public/stylesheets/site/user_skins_to_load/README.md delete mode 100644 public/stylesheets/site/user_skins_to_load/README.txt create mode 100644 public/stylesheets/site/user_skins_to_load/dark_mode.css create mode 100644 public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css create mode 100644 public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_midsize_.css create mode 100644 public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_site_screen_.css create mode 100644 public/stylesheets/site/user_skins_to_load/parent_only/snow_site_screen_.css create mode 100644 public/stylesheets/site/user_skins_to_load/previews/default_preview.png create mode 100644 public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css create mode 100644 public/stylesheets/site/user_skins_to_load/snow_blue_site_screen_.css diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0243a1acc8b..fcb90c63ecc 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -160,7 +160,7 @@ def link_to_help(help_entry, link = '? id).first - unless skin - puts "Couldn't find skin with id #{id} to replace" - return nil - end - end - skin + def parent_skin_path + File.join(user_skin_path, "parent_only") + end + + def default_user_skin_preview + File.join(user_skin_preview_path, "default_preview.png") + end + + def ask(message) + print message + $stdin.gets.chomp.strip end def set_parents(skin, parent_names) @@ -31,7 +33,7 @@ namespace :skins do puts "Empty parent name for #{skin.title}" next else - parent_skin = Skin.where(:title => parent_name).first + parent_skin = Skin.where(title: parent_name).first end unless parent_skin puts "Couldn't find parent #{parent_name} to add, skipping" @@ -39,9 +41,13 @@ namespace :skins do end if (parent_skin.role == "site" || parent_skin.role == "override") && skin.role != "override" skin.role = "override" - skin.save or puts "Problem updating skin #{skin.title} to be replacement skin: #{skin.errors.full_messages.join(', ')}" - next + + unless skin.save + puts "Problem updating skin #{skin.title} to be replacement skin: #{skin.errors.full_messages.join(', ')}" + next + end end + p = skin.skin_parents.build(:parent_skin => parent_skin, :position => parent_position) if p.save parent_position += 1 @@ -51,99 +57,98 @@ namespace :skins do end end - def get_user_skins - dir = Skin.site_skins_dir + 'user_skins_to_load' - default_preview_filename = "#{dir}/previews/default_preview.png" - user_skin_files = Dir.entries(dir).select {|f| f.match(/css$/)} - skins = [] - user_skin_files.each do |skin_file| - skins << File.read("#{dir}/#{skin_file}").split(/\/\*\s*END SKIN\s*\*\//) + def load_parent_user_skins(replace:) + Skin.skin_dir_entries(parent_skin_path, /^.*\.css/).each do |skin_file| + load_user_css( + filename: File.join(parent_skin_path, skin_file), + replace: replace, + parent_only: true + ) end - skins.flatten! end desc "Purge user skins parents" - task(:purge_user_skins_parents => :environment) do - get_user_skins.each do |skin_content| - skin = replace_or_new(skin_content) - if skin.new_record? && skin_content.match(/SKIN:\s*(.*)\s*\*\//) - skin = Skin.find_by_title($1.strip) + task(purge_user_skins_parents: :environment) do + Skin.skin_dir_entries(user_skin_path, /^.*\.css/).each do |skin_file| + filename = File.join(user_skin_path, skin_file) + skin_content = File.read(filename) + + unless skin_content.match(%r{SKIN:\s*(.*)\s*\*/}) + puts "No skin title found for skin #{skin_content}" + next end - skin.skin_parents.delete_all + + skin = Skin.find_by(title: $1.strip) + skin&.skin_parents&.delete_all end end desc "Load user skins" - task(:load_user_skins => :environment) do + task(load_user_skins: :environment) do replace = ask("Replace existing skins with same titles? (y/n) ") == "y" - Rake::Task['skins:purge_user_skins_parents'].invoke if replace - - author = User.find_by_login("lim") - dir = Skin.site_skins_dir + 'user_skins_to_load' - - skins = get_user_skins - skins.each do |skin_content| - next if skin_content.blank? - - # Determine if we're replacing or creating new - next unless (skin = replace_or_new(skin_content)) - - # set the title and preview - if skin_content.match(/SKIN:\s*(.*)\s*\*\//) - title = $1.strip - if (oldskin = Skin.find_by_title(title)) && oldskin.id != skin.id - if replace - skin = oldskin - else - puts "Existing skin with title #{title} - did you mean to replace? Skipping." - next - end - end - skin.title = title - preview_filename = "#{dir}/previews/#{title.gsub(/[^\w\s]+/, '')}.png" - unless File.exists?(preview_filename) - puts "No preview filename #{preview_filename} found for #{title}" - preview_filename = "#{dir}/previews/default_preview.png" - end - File.open(preview_filename, 'rb') {|preview_file| skin.icon = preview_file} - else - puts "No skin title found for skin #{skin_content}" - next - end - # set the css and make public - skin.css = skin_content - skin.public = true - skin.official = true - skin.author = author unless skin.author + Rake::Task["skins:purge_user_skins_parents"].invoke if replace + load_parent_user_skins(replace: replace) - if skin_content.match(/DESCRIPTION:\s*(.*?)\*\//m) - skin.description = "
#{$1}
" - end - if skin_content.match(/PARENT_ONLY/) - skin.unusable = true - end + Skin.skin_dir_entries(user_skin_path, /^.*\.css/).each do |skin_file| + load_user_css( + filename: File.join(user_skin_path, skin_file), + replace: replace, + preview_path: File.join(user_skin_preview_path, "#{skin_file}_preview.png") + ) + end + end - # make sure we have valid skin now - if skin.save - puts "Saved skin #{skin.title}" - else - puts "Problem with skin #{skin.title}: #{skin.errors.full_messages.join(', ')}" - next - end + def load_user_css(filename:, replace: false, parent_only: false, preview_path: default_user_skin_preview) + skin_content = File.read(filename) + return if skin_content.blank? - # recache any cached skins - if skin.cached? - skin.cache! - end + unless skin_content.match(%r{SKIN:\s*(.*)\s*\*/}) + puts "No skin title found for skin #{skin_content}" + return + end + title = $1.strip + + skin = Skin.find_by(title: title) + if skin && !replace + puts "Existing skin with title #{title} - did you mean to replace? Skipping." + return + end + skin ||= Skin.new + + unless File.exist?(preview_path) + puts "No preview filename #{preview_path} found for #{title}" + preview_path = default_user_skin_preview + end + + if skin_content.match(/MEDIA: (.*?) ENDMEDIA/) + skin.media = $1.split(/,\s?/) + elsif skin_content.match(/MEDIA: (\w+)/) + skin.media = [$1] + end - # set parents - if skin_content.match(/PARENTS:\s*(.*)\s*\*\//) + skin.title ||= title + skin.author ||= User.find_by(login: "lim") + skin.description = "
#{$1}
" if skin_content.match(%r{DESCRIPTION:\s*(.*?)\*/}m) + skin.filename = filename + skin.css = nil # get_css should load from filename + skin.public = true + skin.role = "user" + skin.unusable = parent_only + skin.official = true + skin.in_chooser = true unless parent_only + skin.icon.attach(io: File.open(preview_path, "rb"), content_type: "image/png", filename: "preview.png") + if skin.save + puts "Saved skin #{skin.title}" + + skin.cache! if skin.cached? + if skin_content.match(%r{PARENTS:\s*(.*)\s*\*/}) parent_string = $1 set_parents(skin, parent_string) end + else + puts "Problem with skin #{skin.title}: #{skin.errors.full_messages.join(', ')}" end - end desc "Load site skins" @@ -189,5 +194,4 @@ namespace :skins do default_id = AdminSetting.default_skin_id Skin.where("id != ?", default_id).update_all(:official => false) end - end diff --git a/public/stylesheets/site/user_skins_to_load/README.md b/public/stylesheets/site/user_skins_to_load/README.md new file mode 100644 index 00000000000..6af80d9b65b --- /dev/null +++ b/public/stylesheets/site/user_skins_to_load/README.md @@ -0,0 +1,54 @@ +# Guide + +This folder contains CSS files for user skins that are loaded into the development database using the provided rake tasks. The skins can be organized into two categories: +- **Top-Level Skins**: Skins that are added to the skin chooser and subsequently cached. + - Preview images for skins should be placed in the `previews/` subdirectory. If no preview is provided, the default preview image will be used. +- **Parent-Only Skins**: Located in the `parent_only/` subdirectory, skins that are used as parent components for top-level skins. + +## Rake tasks + +### Load user skins +```bash +rake skins:load_user_skins +``` +This task will: +- Prompt you whether to replace existing skins (`y/n`). +- Load top-level skins from the main directory and adds them to the skin chooser. +- Load parent-only skins from the `parent_only/` directory. + +### Cache skins in skin chooser +```bash +rake skins:cache_chooser_skins +``` +This task caches all skins marked as `in_chooser` and the default skin. + +## Syntax for skin files + +Each CSS file represents a single skin. The title of the skin should be specified at the top of the file: +```css +/* SKIN: My Awesome Skin */ +``` + +### Parent Relationships +Skins can specify parent relationships using the `/* PARENTS: */` comment. Parents can be listed by title or by ID for default site skin components: + +```css +/* PARENTS: Dark Mode - Midsize, Dark Mode - Screen */ +``` +or +```css +/* PARENTS: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 */ +``` + +### Additional Metadata +Skins can include optional metadata: +- **Description**: Add a description using the `/* DESCRIPTION: */` comment. +- **Media Queries**: Specify media queries using the `/* MEDIA: ... */` or `/* MEDIA: ... ENDMEDIA */`comment. + +Example: +```css +/* SKIN: Lorem Ipsum */ +/* DESCRIPTION: This skin serves an important purpose. */ +/* PARENTS: Snow */ +/* MEDIA: only screen and (max-width: 62em) ENDMEDIA */ +``` diff --git a/public/stylesheets/site/user_skins_to_load/README.txt b/public/stylesheets/site/user_skins_to_load/README.txt deleted file mode 100644 index 3354d9b34b9..00000000000 --- a/public/stylesheets/site/user_skins_to_load/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -This folder holds skins to load into the database. It can include either: - -- one css file per skin -- one css file containing multiple skins marked out by /* END SKIN */ comments - -Put the title at the top: -/* SKIN: My Awesome Skin */ - -If this is an existing skin to replace, add a comment with the skin id: -/* REPLACE: 3 */ - -Each skin can have a comment to list parents: either skins by title or just numbers for any of the current (2.0) site skin components that are part of this skin. -/* PARENTS: 5, 7, 10 */ -or -/* PARENTS: Archive 1.0 */ - -/* SKIN: Paster for complex ones*/ -/* PARENTS: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 */ -/* END SKIN */ - - - -Load them up with the rake task - -rake skins:load_user_skins - diff --git a/public/stylesheets/site/user_skins_to_load/dark_mode.css b/public/stylesheets/site/user_skins_to_load/dark_mode.css new file mode 100644 index 00000000000..366b50acffa --- /dev/null +++ b/public/stylesheets/site/user_skins_to_load/dark_mode.css @@ -0,0 +1,5 @@ +/* SKIN: Dark Mode */ +/* PARENTS: Dark Mode - Midsize, Dark Mode - Screen */ +/* MEDIA: screen */ + +#unused-selector { content: none; } diff --git a/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css b/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css new file mode 100644 index 00000000000..f5e092d25c1 --- /dev/null +++ b/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css @@ -0,0 +1,191 @@ +/* SKIN: Low Vision Default */ +/* PARENTS: 1, 2, 4, 5, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32 */ + +#outer * { + box-shadow: none; +} + +.icon { + background: none; +} + +#main, +#dashboard, +#dashboard ul, +#main.dashboard, +fieldset, +form dl, +fieldset dl dl, +fieldset fieldset fieldset, +fieldset fieldset dl dl, +dd.hideme, +form blockquote.userstuff { + margin: 2%; + padding: 2%; +} + +#dashboard, +#dashboard ul, +#main.dashboard, +#inbox-form, +.alphabet .listbox li, +.media .listbox, +.works-index .index, +.collections-index .index, +.bookmarks-index .index { + float: none; + width: auto; + max-width: 100%; +} + +#inner .filters, +#footer, +.filters dt, +media .listbox, +.bookmark .recent .index { + width: 100%; +} + +.group .group, +.actions a, +.actions a:link, +.actions a:hover, +.actions a:focus, +.actions input, +.actions input:hover, +.actions input:focus, +.actions button, +.actions button:hover, +.actions button:focus, +.flash, +fieldset, +#header ul.primary li.search, +.listbox fieldset, +fieldset, +form dl, +fieldset dl dl, +fieldset fieldset fieldset, +fieldset fieldset dl dl, +form.single fieldset, +dd.hideme, +form blockquote.userstuff { + border: 2px solid; +} + +ul.navigation + .index { + clear: both; +} + +li.blurb, +.group { + visibility: visible; +} + +li.blurb, +.bookmark div.user { + padding: 3%; +} + +.listbox .blurb, +.group.listbox .index { + margin: auto; +} + +.group.listbox .index, +fieldset.listbox.group { + padding: 0; + border: 0; +} + +fieldset dd dl, +form .meta dd, +fieldset dl fieldset dl, +dd fieldset { + margin: 2% 0; + border: 0; +} + +.meta .stats dl dd, +.meta .stats dl dt { + display: inline-block; +} + +textarea, +pre { + font-size: 200%; +} + +#header li, +#footer li, +.home .primary .navigation a, +.blurb .blurb, +.blurb .actions a, +#header li a, +#footer li a, +#header .open .menu { + display: block; +} + +#header .navigation, +#header li a, +#footer ul, +#footer li a { + float: none; +} + +#header h1 img, +#greeting p.icon, +#header .tip { + visibility: hidden; + display: none; +} + +#header .menu { + display: none; + position: static; +} + +#footer { + float: left; + padding: 0; +} + +#header, +#header .open a, +#header .primary .dropdown a:focus, +#header .user .dropdown a:focus, +#footer, +.actions a:hover, +.actions a:focus { + background: #900; + color: #eee; +} + +#header h1 a { + color: #fff; +} + +#header .dropdown { + background: transparent; +} + +#header .dropdown .menu a { + background: #111; + color: #fff; +} + +#header .dropdown .menu a:hover, +#header .dropdown .menu a:focus { + background: #ccc; + color: #111; +} + +.bookmark div.user { + box-sizing: border-box; +} + +.bookmark .recent, +.bookmark .recent .index { + border: none; +} + diff --git a/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_midsize_.css b/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_midsize_.css new file mode 100644 index 00000000000..ae33efe1d9a --- /dev/null +++ b/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_midsize_.css @@ -0,0 +1,26 @@ +/* SKIN: Dark Mode - Midsize */ +/* MEDIA: only screen and (max-width: 62em) ENDMEDIA */ + +/* 25-MEDIA-MIDSIZE, 24-MEDIA-NARROW */ + +#header .user .open a:focus { + color: #95c6f4; +} + +#outer { + background: #333; +} + +#dashboard .secondary { + background: #2a2a2a; + box-shadow: 1px 1px 3px #000; +} + +.javascript { + background: #2a2a2a; +} + +.javascript form.filters fieldset, +.javascript form.filters dl { + background: transparent; +} diff --git a/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_site_screen_.css b/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_site_screen_.css new file mode 100644 index 00000000000..d1c8b5ce090 --- /dev/null +++ b/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_site_screen_.css @@ -0,0 +1,792 @@ +/* SKIN: Dark Mode - Screen */ +/* MEDIA: screen */ + +/* 01-CORE, 02-ELEMENTS: Very basics */ + +body, +.toggled form, +.dynamic form, +.secondary, +.dropdown { + background: #333; + color: #eee; +} + +a, +a:link, +a:visited:hover, +.heading { + color: #fff; +} + +a:visited { + color: #c2c2c2; +} + +table { + box-shadow: 1px 1px 3px #000; +} + +table, +thead, +tfoot, +tbody, +tr, +th { + background: #2a2a2a; + border: 1px solid #555; +} + +tr { + background: #333; +} + +td { + background: transparent; +} + +tbody tr, +tbody tr:hover { + border-color: #555; +} + +tbody tr:hover { + background: #222; +} + +li.blurb, +fieldset, +form dl { + border-color: #555; +} + +/* 03-REGION-HEADER: The header */ + +#header a, +#header a:visited, +#header .primary .open a, +#header .primary .dropdown:hover a, +#header .primary .dropdown a:focus, +#header #search input:hover, +#header #search input:focus { + color: #fff; +} + +#header .heading a, +#header .user a:hover, +#header .user a:focus { + color: #95c6f4; +} + +#header .actions a:hover, +#header .actions a:focus, +#header .dropdown:hover a, +#header .open a, +#header .menu { + background: #2a2a2a; +} + +#header .menu { + box-shadow: 1px 1px 3px -1px #000; +} + +#header .dropdown .menu a:hover, +#header .dropdown .menu a:focus { + background: #111; +} + +#header .primary { + background: #2a2a2a url("/images/skins/textures/tiles/black-noise.jpg"); +} + +/* 04-REGION-DASHBOARD: The dashboard side bar */ + +#dashboard a, +#dashboard span { + color: #fff; +} + +#dashboard a:hover { + background: #2a2a2a; + color: #c2c2c2; + box-shadow: inset 2px 2px 2px #000; +} + +#dashboard ul { + border-color: #555; +} + +#dashboard .current { + background: #222; + border: 1px solid #555; + box-shadow: -1px -1px 3px #000; +} + +#dashboard, +#dashboard.own { + border-bottom-color: #95c6f4; + border-top-color: #95c6f4; +} + +/* 06-FOOTER */ + +#footer { + background: #2a2a2a url("/images/skins/textures/tiles/black-noise.jpg"); + border-color: #555; +} + +#footer a:hover, +#footer a:focus { + background: #95c6f4; + color: #111; +} + +/* 07-INTERACTIONS: The forms */ + +fieldset, form dl, +fieldset dl dl, +fieldset fieldset fieldset, +fieldset fieldset dl dl, +dd.hideme, +form blockquote.userstuff, +form.verbose legend, +.verbose form legend, +input, +textarea { + background: #333; + border-color: #222; + box-shadow: none; +} + +fieldset fieldset, +fieldset dl dl, +form blockquote.userstuff { + background: transparent; +} + +input, +textarea { + color: #eee; + box-shadow: inset 0 1px 2px #000; +} + +input:focus, +textarea:focus { + background: #2a2a2a; +} + +select:focus { + background-color: initial; +} + +select, +input[type="radio"], +input[type="checkbox"], +input[type="file"] { + color-scheme: dark; +} + +select { + border-color: #222; +} + +form dt { + border-bottom-color: #555; +} + +form dd.required { + color: #eee; +} + +/* widget: live validation */ + +.LV_invalid { + background: #333; + border-color: #ff7575; + color: #ffada8; + box-shadow: none; +} + +.LV_invalid_field, +input.LV_invalid_field:hover, +input.LV_invalid_field:active, +textarea.LV_invalid_field:hover, +textarea.LV_invalid_field:active { + border-color: #ff7575; +} + +/* Firefox's focus indicator is very bright in dark mode, so tone our error color down by decreasing the opacity */ +input.LV_invalid_field:focus, +textarea.LV_invalid_field:focus { + border-color: rgba(255, 117, 117, 0.75); +} + +.LV_invalid:before { + border-color: #ff7575 transparent; +} + +/* widget: autocomplete */ + +.autocomplete div.dropdown ul { + background: #333; + border-color: #222; + color: #eee; +} + +.autocomplete .dropdown ul li:hover, +.autocomplete .dropdown li.selected { + background: #95c6f4; + color: #111; +} + +.required .autocomplete, +.autocomplete .notice { + color: #eee; +} + +/* widget: sortable list */ + +.ui-sortable li { + background: #2a2a2a; + border-color: #222; + box-shadow: 1px 1px 3px transparent; +} + +.ui-sortable li:hover { + background: #333; + border-color: #555; + box-shadow: 1px 1px 3px #000; +} + +.ui-draggable form { + box-shadow: 0 0 3px #000; +} + +/* widget: datepicker, timepicker */ + +#ui-datepicker-div { + background: #333; + box-shadow: 3px 3px 5px #000; +} + +.ui-datepicker table { + background: #333; +} + +.ui-datepicker td { + border-color: #222; +} + +.ui-datepicker tr:hover, +.ui-datepicker td:hover { + background: #555; +} + +/* modal */ + +#modal { + background: #333; + border-color: #222; +} + +#modal .content { + border-bottom-color: #222; +} + +div.dynamic { + background: #333; +} + +/* mods: single */ + +form.single fieldset { + border-color: #555; +} + +/* widget: toggled forms */ + +.toggled form, +.dynamic form { + border-color: #222; + box-shadow: none; +} + +.post .required .warnings { + color: #eee; +} + +/* rich text editor */ + +.mce-container button { + box-shadow: none; +} + +.mce-container input:focus { + background: #f3efec; +} + +/* 08-ACTIONS */ + +.actions a, +.actions a:link, +.action, +.action:link, +.actions button, +.actions input, +input[type="submit"], +button, +.current, +.actions label { + background: #555; + border-color: #222; + color: #eee; + box-shadow: inset 0 -8px 4px #232323, inset 0 8px 7px #555; + text-shadow: none; +} + +.actions a:visited, +.action:visited, +.action a:link, +.action a:visited { + color: #eee; +} + +.actions a:hover, +.actions button:hover, +.actions input:hover, +.actions a:focus, +.actions button:focus, +.actions input:focus, +label.action:hover, +.action:hover, +.action:focus { + border-color: #000; + color: #fafafa; + box-shadow: inset 2px 2px 2px #000; +} + +.actions a:active, +.current, +a.current, +a:link.current, +.current a:visited, +span.unread, +.replied, +span.claimed, +.actions span.defaulted { + background: #555; + border-color: #fff; + color: #fff; + box-shadow: inset 1px 1px 3px #333; +} + +.current, +a.current, +a:link.current { + background: #222; + border-color: #555; + box-shadow: -1px -1px 3px #000; +} + +.actions label.disabled { + background: #222; +} + +.actions .disabled select { + color: #999; + border-color: #000; +} + +.delete a, +span.delete { + color: #ffada8; +} + +.secondary { + background: #2a2a2a; + border-color: #555; + box-shadow: 1px 1px 3px #000; +} + +/* don't let iOS add its special styling for dark buttons */ +button, +input[type="button"], +input[type="submit"] { + -webkit-appearance: none; +} + +/* 09-ROLES-STATES */ + +.own, +.draft, +.draft .wrapper, +.unread, +.child, +.unwrangled, +.unreviewed { + background: #222; + border-color: #555; +} + +span.unread, +.replied, +span.claimed, +.actions span.defaulted { + background: #222; + border-color: #555; + box-shadow: -1px -1px 3px #000; +} + +.draggable, +.droppable, +span.requested, +.nominations .rejected { + color: #ffada8; +} + +.actions span.defaulted { + color: #eee; +} + +span.offered, +.replied, +.nominations .approved { + color: #a8ffad; +} + +.nominations .approved, +.nominations .rejected { + background: #333; +} + +span.offered.requested { + color: #ffe6a8; +} + +/* 10-TYPES-GROUPS */ + +a.tag:hover, +.listbox .heading a.tag:visited:hover { + background: #95c6f4; + color: #111; +} + +.wrapper { + box-shadow: 1px 1px 3px #000; +} + +dl.index dd, +li.relationships a { + background: #2a2a2a; +} + +a.work { + color: #95c6f4; +} + +.actions .reindex a { + border-bottom-color: #95c6f4; +} + +span.series .divider { + color: #999; +} + +.statistics .index li:nth-of-type(even) { + background: #333; +} + +#inner .module .heading { + border-color: #555; +} + +/* 11-GROUP-LISTBOX */ + +.listbox, +fieldset fieldset.listbox { + background: #2a2a2a; + border-color: #555; + box-shadow: 1px 1px 3px #000; +} + +.listbox > .heading { + color: #fff; +} + +.listbox .heading a:visited { + color: #c2c2c2; +} + +.listbox .index { + background: #2a2a2a; + box-shadow: inset 1px 1px 3px #000; +} + +/* 12-GROUP-META */ + +dl.meta { + border-color: #555; +} + +/* 13-GROUP-BLURB */ + +li.blurb, +.listbox li.blurb { + box-shadow: 1px 1px 3px #000; +} + +.blurb .blurb { + background: #2a2a2a; + box-shadow: inset 1px 1px 3px #000; +} + +.blurb h4 a:link { + color: #95c6f4; +} + +.picture .header { + border-color: #555; +} + +.listbox li.blurb { + background: #333; +} + +.bookmark .user { + border-color: #555; +} + +.reading h4.viewed { + background: #2a2a2a; +} + +/* 15-GROUP-COMMENT */ + +div.comment, +li.comment { + border-color: #555; + box-shadow: 1px 1px 3px #000; +} + +.comment h4.byline { + background: transparent; +} + +.comment div.icon { + border-bottom-color: #555; +} + +.thread .even { + background: #2a2a2a; +} + +/* 16-ZONE-SYSTEM */ + +.splash .module h3 { + border-bottom-color: #555; + color: #95c6f4; +} + +/* module: browse */ + +.splash .browse li a:before { + color: #95c6f4; +} + +/* module: favorite tags */ + +.splash .favorite li:nth-of-type(odd) a { + background: #2a2a2a; +} + +.splash .favorite li:nth-of-type(odd) a:hover, +.splash .favorite li:nth-of-type(odd) a:focus { + background: #95c6f4; +} + +/* module: intro */ + +.splash .module div.account { + background: transparent; + border-color: #555; + box-shadow: 1px 1px 3px #000; +} + +/* module: news */ + +.splash .news li { + border-bottom-color: #2a2a2a; +} + +/* 6. ZONE: SYSTEM: FAQS */ + +.faq .categories h3 { + border-bottom-color: #eee; +} + +.faq .example, +.guideline .example { + border-color: #75bcff; +} + +/* 7. ZONE: SYSTEM: TOS, TOS FAQ, AND TOS POPUP */ + +.tos .userstuff nav.toc > details > summary { + border-bottom-color: #eee; +} + +#tos_prompt { + background: #333; +} + +#tos_prompt .heading { + background: #2a2a2a; + color: #95c6f4; +} + +#tos_prompt [disabled] { + background: #222; +} + +/* 8. ZONE: SYSTEM: PROXY NOTICE */ + +#proxy-notice { + background: #330f0f; + border-bottom-color: #ff7575; +} + +/* 18-ZONE-SEARCH-BROWSE */ + +form.search input[type="text"] { + border-top-color: #000; +} + +.search [role="tooltip"] { + background: #95c6f4; + border-color: #111; +} + +form.filters fieldset { + border: 1px solid #555; + box-shadow: 1px 1px 3px #000; +} + +.filters .expander { + color: #eee; + box-shadow: none; +} + +.filters .group dt.bookmarker { + border-top-color: #444; +} + +/* 19-ZONE-TAGS */ + +.nomination dt { + background: #333; +} + +/* 21-USERSTUFF */ + +.userstuff h2 { + color: #fff; +} + +.userstuff h3 { + border-bottom-color: #555; +} + +.userstuff blockquote { + border-left-color: #555; +} + +.userstuff table { + box-shadow: none; +} + +/* 22-SYSTEM-MESSAGES */ + +.announcement .action { + background: #333; + border-color: #222; +} + +.required { + color: #83caff; +} + +.error, +.alert.flash { + color: #eee; +} + +.notice, +.comment_notice, +.kudos_notice, +ul.notes, +.qtip-content { + background: #333; + border-color: #75bcff; + box-shadow: none; +} + +.caution { + background: #333; + border-color: #ffd875; + color: #ffe6a8; + box-shadow: none; +} + +.error, +.comment_error, +.kudos_error, +.alert.flash { + background: #333; + border-color: #ff7575; + color: #ffada8; + box-shadow: none; +} + +form .notice, +form ul.notes { + box-shadow: none; +} + +/* symbols */ + +span.symbol { + color: #95c6f4; +} + +span.question { + background: #95c6f4; + border-color: #111; + color: #111; + box-shadow: none; +} + +/* 24-ROLE-ADMIN */ + +/* Note: There is no reasonable way to change the #footer background for admins outside the default site skin, which only loads 24-role-admin.css if the user is logged in as an admin. Styles in this and other skins will be loaded for everyone. */ + +#header .admin { + background: #277e7e; + border-top-color: #333; +} + +#header .admin a:hover, +#header .admin a:focus { + color: #fff; +} + +.admin .management a { + border-bottom-color: #73c4c4; +} + +#admin_users_table th a:visited { + color: #c2c2c2; +} + +#admin_users_table th a:hover { + color: #73c4c4; +} diff --git a/public/stylesheets/site/user_skins_to_load/parent_only/snow_site_screen_.css b/public/stylesheets/site/user_skins_to_load/parent_only/snow_site_screen_.css new file mode 100644 index 00000000000..c4f983f6f3a --- /dev/null +++ b/public/stylesheets/site/user_skins_to_load/parent_only/snow_site_screen_.css @@ -0,0 +1,59 @@ +/* SKIN: Snow */ +/* MEDIA: screen */ + +body, +th, +tr:hover, +col.name, +fieldset fieldset, +fieldset dl dl, +form blockquote.userstuff, +button:focus, +input:focus, +select:focus, +textarea:focus, +.autocomplete div.dropdown ul, +#ui-datepicker-div, +#ibox_wrapper, +#ibox_content, +.toggled form, +.dynamic form, +.secondary, +.listbox .index, +.dashboard .listbox .index, +.nomination dt { + background: #fff; +} + +#header h2, +#footer ul, +#footer ul.navigation a, +.autocomplete .dropdown ul li:hover, +.autocomplete .dropdown li.selected, +a.tag:hover { + color: #fff; +} + +tbody tr, +thead td, +#header #small_login, +fieldset, +form dl, +fieldset dl dl, +fieldset fieldset fieldset, +fieldset fieldset dl dl, +dd.hideme, +form blockquote.userstuff, +form dt, +.actions a:active, +.current, +a.current, +.current a:visited, +.search span.tip { + border-color: #fff; +} + +form .notice, +form ul.notes { + box-shadow: 0px 0 3px #fff; +} diff --git a/public/stylesheets/site/user_skins_to_load/previews/default_preview.png b/public/stylesheets/site/user_skins_to_load/previews/default_preview.png new file mode 100644 index 0000000000000000000000000000000000000000..2934d8828ca67c55d1d9aab05d3cfbf1c4c4d2ec GIT binary patch literal 3688 zcmY*b2T+q;vwkUtDkPu~diki*K`Dw9ArJ^1L?TTAiS!;iM3JU+gh;QEUX>E6C>^AU z2!e#FM0$~8D3|ZQb7%fLJJ0UU&hDJE&+M7Au|@{kS83U40RXtF1J^XUv=0A*8g!{W zm(t8G4JArlUmXDI5<*DEsQ^H$k|Ng_vNJf zo0)xMi5_kD4=VU9O>Po3-}(WV2u`(uJ$}RXNQ8nx?q(fdAvpx5naK|~>c)&437Biv zfv=g>QVCFt$UtFc;vQO4uc|BCj`sFQ%atCR?~d@KjrP%ptUyYM6c!6YkR=T=??fnP z6CugQz8e6BjQbHr6wou*YO$>irUnlTeU8lK^Cq{YB-;tHXe0OhGA4&Hpt{H_MiN7w zt-S#tS?`qC#38IPih_tF$;Q!_Z`iToj!;3z4iR<8P^{A9hWoJ$JE5o$>FobAq1v6t(VeiVoM53(`F2E6u>ndS5{ApSblkkOe_!6 z3jfk7umGpA^_qJizTiODjrG<+j4t{xGhOlJN|*dG`8`wpXvG2NNlE?*5E9E6Kz*^E zF!_?v#tE=&pCVfc_sOyDy3WrnuCD>sx0FqrS3KEV+71e4UrMc{&99NtTKAfbq;Q zy0f6B10|rcmAE%%t+cE6_$5ZNnnO%NP`|$fRV;_(Y+1~UKIWl1_u~esX9qCkePV{a zh{QL(GbJ-yPWF06QEBm%L( z-c05mL3(se4}*Hd(gvafQ$FUC)qJ+XcOA|=5k1Tca$v-(cNl@M(e&J-0W&h)3mkJS zh2DrLF9<4S`^$ZsCMUXDEn>|2DSc*CSoC}swchixTBgb?9G~bf&wHk^aNm=>4Kxx- zx4`8oI0x`V-dWh+xpgeBOsg943yc9n*b84m`RTi_>}nS#1-wYC)P9*nTTJEzYe`mF z5t4m5%A3$+S0?BGjy0UHz32_5eShiZq&6`Fzd6giUsQ3+92(YKR9W$b0CCjXfDOk8s^ zbqXh%5t)epOgtzqaj2DjDC;iknn9isAns9^x+|i zG@sYY{nrN?27aUm3mannQw`Gzf&|eEBQjim3Ai)~S8Kai_;J|ex5+H75(h&hO0}0z zi~SY_iB{iNE}gDXEGe#BDR^CNhVxZ-(#m+dQJP(BRUM)g_%O22uIA%?(FaNud#@!C z{)HuDV#M|XLZ@ZP_ik^QU%?Q|u<5dK1igCueUG-p?NR%iWbrN5;=c_|)TDPeA*U`>aC;Sg-U= zTXf%ZyG2yp*TTM~2wa*Vq5iA)cim4nrpl+BU#LH!l-7k}tH!5BrZ_4Mk(~{7?;+Ei zO(&nH#^h%XV>TzfH&?S)k@&IB7@N!{p^#G&5?acdC7IF5j=l2cQve`iaU$bs z`>8)km41xDf_cZDS4f(-R%k~j$;rsZ$W~fVQRo=Hvkv~1G?7FqxLxpZELVDg5{4^Z;bzn0pToR=Mul9lb1C|7N?QgEhypXjn)?`#jY$53!u zaKqq@fiJugp1s)OS%H^IQBM7x@-y`;l~FKUm&VWu(Sz%Ko4YcwlM>kOH0U(r6hZt; zj3gGhxK3>#<%W(H6`rWERmiqbnvIW|bsA|m!xYn<@{p+~LSo|UnvK5lQmv}mQmEh& zhw9+1CKqEDq)YIg*}nX0e3j3`2c6sxd73&<5r3neUuEXFE6+WzIsLkgSQ3(YT7UW= z>yv^%tH^a%aVTM_4u>-;OtMw1|B80`AwMa<)%a}l=WIn|xVRmwwS>HAwMdxl#~b*+ z@kE6*LdbVWr+xlpz3+v=u)+MuqBTP+16BvSnjXJ>IQzrcKuYRHc!RLxXxhss*ZqQN zf+K^q#X`ke%WsyW&D(1XDm$!~t-hF7ShTjI!+3%TV_|(~RerjDJ$~B^o{V#4N2S|O z$DB(QW0c+m?&#QC*b|!KJhHN`WxmW(;auWkzsu>{+%!{;KZ#jNo?vN)P0NPf{JR#v zZPmH%e9N`Uqp0CJ4@KXLzT7Y#(%Ftz-tt{xsPMz^vD1RaoC%vrGQSnyVYCoB0S!Z6 z%{@?=`QkSF(=(A!v)W^ot)&gp}!fgX$Jy;N&dFh(4= zxw1*fqLMzVzP~(FsvW8$?BR!qUa4(i+T5f(Gre*>dBY6-oJ@3H$FA?{ zmsk{Wl*N%YJng*U5I?fd6XtVT6)tawUb=G8Q$j%440b9XIL}n%;xTyb8dF=TVb=EK zaGzs|Wj8|Wj(;j0a=UI@Om!`6?R;&2x2t5*Fz@^d#hd-pmhQDLmrEtDJ={be0HPTI zAnp=pmz(D^H2??=1OVbI08m~90JdQtVQ^ikMJKo%IX$|?_h0ye{ zl!k!bfZSgcXzsAvA)VAS2Dwm5Op+3>ZO7Sbyfl3H@;AQ}-~~X*OUVoHxsV4c*{rNK zSLNtB%W&UE|3Kde^09v~NGx#d-{p^92Kh_6Xcl7|nITRBGL4;xC(nZNQ~n^#8XJAe zR;>RSz`r)vEDmdOG?qHauoG6Q-7Y2UD87F<`ztUfYS;JLKU_^}0Z$Bk%a%$mf(5RwX zNufW(hw5W_)zZU!Vkn3t>+S{@tU(O;yy@4fnS5v0w! z!vGL9b%Z^nN*bkHSx+SJY)iWch0#blR54bY>jk@g$R^8nt)UQ&5A_Orpz<-3FhIYH z7&cX@cBzW~-g;}E^F#k3AG7L2Cc$=~o^u}Ra(8n695k8^H6#hsZxux3XKEZoC?29aA%1yiKYfUN>-$hq1slNr|76+H;-+4jQkY zY3W<6LpD)~e07^e`lnErurGo`e}BxmH!}}V^q?*;Fl!#XWwEt*Wcb^ryyYnK_`> Date: Sat, 23 Aug 2025 12:49:33 +0000 Subject: [PATCH 2/7] Create official work skin in load_user_skins --- lib/tasks/skin_tasks.rake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tasks/skin_tasks.rake b/lib/tasks/skin_tasks.rake index c12af15a3ba..2743ab9cfbf 100644 --- a/lib/tasks/skin_tasks.rake +++ b/lib/tasks/skin_tasks.rake @@ -97,6 +97,9 @@ namespace :skins do preview_path: File.join(user_skin_preview_path, "#{skin_file}_preview.png") ) end + + # Create Basic Formatting as an official work skin + WorkSkin.basic_formatting end def load_user_css(filename:, replace: false, parent_only: false, preview_path: default_user_skin_preview) From e52ae0f800d77c1cf4f595f1a5f8718fc10645bd Mon Sep 17 00:00:00 2001 From: weeklies <80141759+weeklies@users.noreply.github.com> Date: Fri, 12 Sep 2025 20:15:43 +0000 Subject: [PATCH 3/7] Sync stylesheets --- public/stylesheets/README.md | 2 ++ .../low_vision_default_site_screen_.css | 27 +++++++++++-------- .../reversi_site_screen_.css | 2 ++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/public/stylesheets/README.md b/public/stylesheets/README.md index 05328da9cdd..8ce9fcfc080 100644 --- a/public/stylesheets/README.md +++ b/public/stylesheets/README.md @@ -21,3 +21,5 @@ process as all other code changes. Remember, though: changes to a skin's files in the masters directory will not affect the skin on production! An admin will still need to edit the skin via the admin interface and paste in the updated master version. + +**Note**: To keep development data in sync with the master copies, please ensure any skin changes are mirrored in `site/user_skins_to_load`. diff --git a/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css b/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css index f5e092d25c1..63191e41cbc 100644 --- a/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css +++ b/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css @@ -39,7 +39,6 @@ form blockquote.userstuff { } #inner .filters, -#footer, .filters dt, media .listbox, .bookmark .recent .index { @@ -122,14 +121,14 @@ pre { .blurb .actions a, #header li a, #footer li a, +#footer li button, #header .open .menu { display: block; } #header .navigation, #header li a, -#footer ul, -#footer li a { +#footer * { float: none; } @@ -145,18 +144,17 @@ pre { position: static; } -#footer { - float: left; - padding: 0; -} - #header, #header .open a, #header .primary .dropdown a:focus, #header .user .dropdown a:focus, #footer, .actions a:hover, -.actions a:focus { +.actions a:focus, +input[type="submit"]:hover, +input[type="submit"]:focus, +button:hover, +button:focus { background: #900; color: #eee; } @@ -180,12 +178,19 @@ pre { color: #111; } +#footer button { + cursor: pointer; + height: unset; + width: 100%; + white-space: normal; + box-sizing: border-box; +} + .bookmark div.user { - box-sizing: border-box; + box-sizing: border-box; } .bookmark .recent, .bookmark .recent .index { border: none; } - diff --git a/public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css b/public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css index 3f9d2ec356f..a6988948a81 100644 --- a/public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css +++ b/public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css @@ -161,6 +161,8 @@ fieldset fieldset.listbox, #footer a:hover, #footer a:focus, +#footer button:hover, +#footer button:focus, .autocomplete .dropdown ul li:hover, .autocomplete .dropdown li.selected, a.tag:hover, From 70f1a92d5349bce9f863ae3059774973fee17f9d Mon Sep 17 00:00:00 2001 From: weeklies <80141759+weeklies@users.noreply.github.com> Date: Fri, 12 Sep 2025 20:28:42 +0000 Subject: [PATCH 4/7] dog --- app/helpers/application_helper.rb | 2 +- lib/tasks/skin_tasks.rake | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d5fc02c206e..abb8e9fc37a 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -160,7 +160,7 @@ def link_to_help(help_entry, link = '? Date: Thu, 18 Sep 2025 20:02:09 +0000 Subject: [PATCH 5/7] Try to integrate script with masters/ directory structure --- lib/tasks/skin_tasks.rake | 41 +- .../masters/dark_mode/dark_mode_midsize_.css | 23 - .../dark_mode/dark_mode_site_screen_.css | 789 ------------------ .../low_vision_default_site_screen_.css | 193 ----- .../dark_mode}/dark_mode_midsize_.css | 0 .../dark_mode}/dark_mode_site_screen_.css | 0 .../masters/{ => parent_only}/snow/README.md | 0 .../parent_only/snow}/snow_site_screen_.css | 0 .../previews/default_preview.png | Bin .../masters/reversi/reversi_site_screen_.css | 383 --------- .../masters/snow/snow_site_screen_.css | 56 -- .../snow_blue/snow_blue_site_screen_.css | 65 -- .../{ => top_level}/dark_mode/README.md | 0 .../top_level/dark_mode}/dark_mode.css | 0 .../low_vision_default/README.md | 0 .../low_vision_default_site_screen_.css | 0 .../masters/{ => top_level}/reversi/README.md | 0 .../reversi}/reversi_site_screen_.css | 0 .../{ => top_level}/snow_blue/README.md | 0 .../snow_blue}/snow_blue_site_screen_.css | 0 20 files changed, 23 insertions(+), 1527 deletions(-) delete mode 100644 public/stylesheets/masters/dark_mode/dark_mode_midsize_.css delete mode 100644 public/stylesheets/masters/dark_mode/dark_mode_site_screen_.css delete mode 100644 public/stylesheets/masters/low_vision_default/low_vision_default_site_screen_.css rename public/stylesheets/{site/user_skins_to_load/parent_only => masters/parent_only/dark_mode}/dark_mode_midsize_.css (100%) rename public/stylesheets/{site/user_skins_to_load/parent_only => masters/parent_only/dark_mode}/dark_mode_site_screen_.css (100%) rename public/stylesheets/masters/{ => parent_only}/snow/README.md (100%) rename public/stylesheets/{site/user_skins_to_load/parent_only => masters/parent_only/snow}/snow_site_screen_.css (100%) rename public/stylesheets/{site/user_skins_to_load => masters}/previews/default_preview.png (100%) delete mode 100644 public/stylesheets/masters/reversi/reversi_site_screen_.css delete mode 100644 public/stylesheets/masters/snow/snow_site_screen_.css delete mode 100644 public/stylesheets/masters/snow_blue/snow_blue_site_screen_.css rename public/stylesheets/masters/{ => top_level}/dark_mode/README.md (100%) rename public/stylesheets/{site/user_skins_to_load => masters/top_level/dark_mode}/dark_mode.css (100%) rename public/stylesheets/masters/{ => top_level}/low_vision_default/README.md (100%) rename public/stylesheets/{site/user_skins_to_load => masters/top_level/low_vision_default}/low_vision_default_site_screen_.css (100%) rename public/stylesheets/masters/{ => top_level}/reversi/README.md (100%) rename public/stylesheets/{site/user_skins_to_load => masters/top_level/reversi}/reversi_site_screen_.css (100%) rename public/stylesheets/masters/{ => top_level}/snow_blue/README.md (100%) rename public/stylesheets/{site/user_skins_to_load => masters/top_level/snow_blue}/snow_blue_site_screen_.css (100%) diff --git a/lib/tasks/skin_tasks.rake b/lib/tasks/skin_tasks.rake index 92bee022b27..f52c7d41185 100644 --- a/lib/tasks/skin_tasks.rake +++ b/lib/tasks/skin_tasks.rake @@ -1,18 +1,24 @@ namespace :skins do - def user_skin_path - File.join(Skin.site_skins_dir, "user_skins_to_load") + def masters_dir + Rails.public_path.join("stylesheets/masters/") end - def user_skin_preview_path - File.join(user_skin_path, "previews") + def top_level_skins + dir = File.join(masters_dir, "top_level") + Dir["#{dir}/*/*.css"] end - def parent_skin_path - File.join(user_skin_path, "parent_only") + def skin_previews_path + File.join(masters_dir, "previews") end - def default_user_skin_preview - File.join(user_skin_preview_path, "default_preview.png") + def parent_only_skins + dir = File.join(masters_dir, "parent_only") + Dir["#{dir}/*/*.css"] + end + + def default_skin_preview_path + File.join(skin_previews_path, "default_preview.png") end def ask(message) @@ -58,9 +64,9 @@ namespace :skins do end def load_parent_user_skins(replace:) - Skin.skin_dir_entries(parent_skin_path, /^.*\.css/).each do |skin_file| + parent_only_skins.each do |skin_file| load_user_css( - filename: File.join(parent_skin_path, skin_file), + filename: skin_file, replace: replace, parent_only: true ) @@ -69,9 +75,8 @@ namespace :skins do desc "Purge user skins parents" task(purge_user_skins_parents: :environment) do - Skin.skin_dir_entries(user_skin_path, /^.*\.css/).each do |skin_file| - filename = File.join(user_skin_path, skin_file) - skin_content = File.read(filename) + top_level_skins.each do |skin_file| + skin_content = File.read(skin_file) unless skin_content.match(%r{SKIN:\s*(.*)\s*\*/}) puts "No skin title found for skin #{skin_content}" @@ -90,11 +95,11 @@ namespace :skins do Rake::Task["skins:purge_user_skins_parents"].invoke if replace load_parent_user_skins(replace: replace) - Skin.skin_dir_entries(user_skin_path, /^.*\.css/).each do |skin_file| + top_level_skins.each do |skin_file| load_user_css( - filename: File.join(user_skin_path, skin_file), + filename: skin_file, replace: replace, - preview_path: File.join(user_skin_preview_path, "#{skin_file}_preview.png") + preview_path: File.join(File.dirname(skin_file), "preview.png") ) end @@ -102,7 +107,7 @@ namespace :skins do WorkSkin.basic_formatting end - def load_user_css(filename:, replace: false, parent_only: false, preview_path: default_user_skin_preview) + def load_user_css(filename:, replace: false, parent_only: false, preview_path: default_skin_preview_path) skin_content = File.read(filename) return if skin_content.blank? @@ -121,7 +126,7 @@ namespace :skins do unless File.exist?(preview_path) puts "No preview filename #{preview_path} found for #{title}" - preview_path = default_user_skin_preview + preview_path = default_skin_preview_path end case skin_content diff --git a/public/stylesheets/masters/dark_mode/dark_mode_midsize_.css b/public/stylesheets/masters/dark_mode/dark_mode_midsize_.css deleted file mode 100644 index 91dbf3745dd..00000000000 --- a/public/stylesheets/masters/dark_mode/dark_mode_midsize_.css +++ /dev/null @@ -1,23 +0,0 @@ -/* 25-MEDIA-MIDSIZE, 24-MEDIA-NARROW */ - -#header .user .open a:focus { - color: #95c6f4; -} - -#outer { - background: #333; -} - -#dashboard .secondary { - background: #2a2a2a; - box-shadow: 1px 1px 3px #000; -} - -.javascript { - background: #2a2a2a; -} - -.javascript form.filters fieldset, -.javascript form.filters dl { - background: transparent; -} diff --git a/public/stylesheets/masters/dark_mode/dark_mode_site_screen_.css b/public/stylesheets/masters/dark_mode/dark_mode_site_screen_.css deleted file mode 100644 index 04a9409104c..00000000000 --- a/public/stylesheets/masters/dark_mode/dark_mode_site_screen_.css +++ /dev/null @@ -1,789 +0,0 @@ -/* 01-CORE, 02-ELEMENTS: Very basics */ - -body, -.toggled form, -.dynamic form, -.secondary, -.dropdown { - background: #333; - color: #eee; -} - -a, -a:link, -a:visited:hover, -.heading { - color: #fff; -} - -a:visited { - color: #c2c2c2; -} - -table { - box-shadow: 1px 1px 3px #000; -} - -table, -thead, -tfoot, -tbody, -tr, -th { - background: #2a2a2a; - border: 1px solid #555; -} - -tr { - background: #333; -} - -td { - background: transparent; -} - -tbody tr, -tbody tr:hover { - border-color: #555; -} - -tbody tr:hover { - background: #222; -} - -li.blurb, -fieldset, -form dl { - border-color: #555; -} - -/* 03-REGION-HEADER: The header */ - -#header a, -#header a:visited, -#header .primary .open a, -#header .primary .dropdown:hover a, -#header .primary .dropdown a:focus, -#header #search input:hover, -#header #search input:focus { - color: #fff; -} - -#header .heading a, -#header .user a:hover, -#header .user a:focus { - color: #95c6f4; -} - -#header .actions a:hover, -#header .actions a:focus, -#header .dropdown:hover a, -#header .open a, -#header .menu { - background: #2a2a2a; -} - -#header .menu { - box-shadow: 1px 1px 3px -1px #000; -} - -#header .dropdown .menu a:hover, -#header .dropdown .menu a:focus { - background: #111; -} - -#header .primary { - background: #2a2a2a url("/images/skins/textures/tiles/black-noise.jpg"); -} - -/* 04-REGION-DASHBOARD: The dashboard side bar */ - -#dashboard a, -#dashboard span { - color: #fff; -} - -#dashboard a:hover { - background: #2a2a2a; - color: #c2c2c2; - box-shadow: inset 2px 2px 2px #000; -} - -#dashboard ul { - border-color: #555; -} - -#dashboard .current { - background: #222; - border: 1px solid #555; - box-shadow: -1px -1px 3px #000; -} - -#dashboard, -#dashboard.own { - border-bottom-color: #95c6f4; - border-top-color: #95c6f4; -} - -/* 06-FOOTER */ - -#footer { - background: #2a2a2a url("/images/skins/textures/tiles/black-noise.jpg"); - border-color: #555; -} - -#footer a:hover, -#footer a:focus { - background: #95c6f4; - color: #111; -} - -/* 07-INTERACTIONS: The forms */ - -fieldset, form dl, -fieldset dl dl, -fieldset fieldset fieldset, -fieldset fieldset dl dl, -dd.hideme, -form blockquote.userstuff, -form.verbose legend, -.verbose form legend, -input, -textarea { - background: #333; - border-color: #222; - box-shadow: none; -} - -fieldset fieldset, -fieldset dl dl, -form blockquote.userstuff { - background: transparent; -} - -input, -textarea { - color: #eee; - box-shadow: inset 0 1px 2px #000; -} - -input:focus, -textarea:focus { - background: #2a2a2a; -} - -select:focus { - background-color: initial; -} - -select, -input[type="radio"], -input[type="checkbox"], -input[type="file"] { - color-scheme: dark; -} - -select { - border-color: #222; -} - -form dt { - border-bottom-color: #555; -} - -form dd.required { - color: #eee; -} - -/* widget: live validation */ - -.LV_invalid { - background: #333; - border-color: #ff7575; - color: #ffada8; - box-shadow: none; -} - -.LV_invalid_field, -input.LV_invalid_field:hover, -input.LV_invalid_field:active, -textarea.LV_invalid_field:hover, -textarea.LV_invalid_field:active { - border-color: #ff7575; -} - -/* Firefox's focus indicator is very bright in dark mode, so tone our error color down by decreasing the opacity */ -input.LV_invalid_field:focus, -textarea.LV_invalid_field:focus { - border-color: rgba(255, 117, 117, 0.75); -} - -.LV_invalid:before { - border-color: #ff7575 transparent; -} - -/* widget: autocomplete */ - -.autocomplete div.dropdown ul { - background: #333; - border-color: #222; - color: #eee; -} - -.autocomplete .dropdown ul li:hover, -.autocomplete .dropdown li.selected { - background: #95c6f4; - color: #111; -} - -.required .autocomplete, -.autocomplete .notice { - color: #eee; -} - -/* widget: sortable list */ - -.ui-sortable li { - background: #2a2a2a; - border-color: #222; - box-shadow: 1px 1px 3px transparent; -} - -.ui-sortable li:hover { - background: #333; - border-color: #555; - box-shadow: 1px 1px 3px #000; -} - -.ui-draggable form { - box-shadow: 0 0 3px #000; -} - -/* widget: datepicker, timepicker */ - -#ui-datepicker-div { - background: #333; - box-shadow: 3px 3px 5px #000; -} - -.ui-datepicker table { - background: #333; -} - -.ui-datepicker td { - border-color: #222; -} - -.ui-datepicker tr:hover, -.ui-datepicker td:hover { - background: #555; -} - -/* modal */ - -#modal { - background: #333; - border-color: #222; -} - -#modal .content { - border-bottom-color: #222; -} - -div.dynamic { - background: #333; -} - -/* mods: single */ - -form.single fieldset { - border-color: #555; -} - -/* widget: toggled forms */ - -.toggled form, -.dynamic form { - border-color: #222; - box-shadow: none; -} - -.post .required .warnings { - color: #eee; -} - -/* rich text editor */ - -.mce-container button { - box-shadow: none; -} - -.mce-container input:focus { - background: #f3efec; -} - -/* 08-ACTIONS */ - -.actions a, -.actions a:link, -.action, -.action:link, -.actions button, -.actions input, -input[type="submit"], -button, -.current, -.actions label { - background: #555; - border-color: #222; - color: #eee; - box-shadow: inset 0 -8px 4px #232323, inset 0 8px 7px #555; - text-shadow: none; -} - -.actions a:visited, -.action:visited, -.action a:link, -.action a:visited { - color: #eee; -} - -.actions a:hover, -.actions button:hover, -.actions input:hover, -.actions a:focus, -.actions button:focus, -.actions input:focus, -label.action:hover, -.action:hover, -.action:focus { - border-color: #000; - color: #fafafa; - box-shadow: inset 2px 2px 2px #000; -} - -.actions a:active, -.current, -a.current, -a:link.current, -.current a:visited, -span.unread, -.replied, -span.claimed, -.actions span.defaulted { - background: #555; - border-color: #fff; - color: #fff; - box-shadow: inset 1px 1px 3px #333; -} - -.current, -a.current, -a:link.current { - background: #222; - border-color: #555; - box-shadow: -1px -1px 3px #000; -} - -.actions label.disabled { - background: #222; -} - -.actions .disabled select { - color: #999; - border-color: #000; -} - -.delete a, -span.delete { - color: #ffada8; -} - -.secondary { - background: #2a2a2a; - border-color: #555; - box-shadow: 1px 1px 3px #000; -} - -/* don't let iOS add its special styling for dark buttons */ -button, -input[type="button"], -input[type="submit"] { - -webkit-appearance: none; -} - -/* 09-ROLES-STATES */ - -.own, -.draft, -.draft .wrapper, -.unread, -.child, -.unwrangled, -.unreviewed { - background: #222; - border-color: #555; -} - -span.unread, -.replied, -span.claimed, -.actions span.defaulted { - background: #222; - border-color: #555; - box-shadow: -1px -1px 3px #000; -} - -.draggable, -.droppable, -span.requested, -.nominations .rejected { - color: #ffada8; -} - -.actions span.defaulted { - color: #eee; -} - -span.offered, -.replied, -.nominations .approved { - color: #a8ffad; -} - -.nominations .approved, -.nominations .rejected { - background: #333; -} - -span.offered.requested { - color: #ffe6a8; -} - -/* 10-TYPES-GROUPS */ - -a.tag:hover, -.listbox .heading a.tag:visited:hover { - background: #95c6f4; - color: #111; -} - -.wrapper { - box-shadow: 1px 1px 3px #000; -} - -dl.index dd, -li.relationships a { - background: #2a2a2a; -} - -a.work { - color: #95c6f4; -} - -.actions .reindex a { - border-bottom-color: #95c6f4; -} - -span.series .divider { - color: #999; -} - -.statistics .index li:nth-of-type(even) { - background: #333; -} - -#inner .module .heading { - border-color: #555; -} - -/* 11-GROUP-LISTBOX */ - -.listbox, -fieldset fieldset.listbox { - background: #2a2a2a; - border-color: #555; - box-shadow: 1px 1px 3px #000; -} - -.listbox > .heading { - color: #fff; -} - -.listbox .heading a:visited { - color: #c2c2c2; -} - -.listbox .index { - background: #2a2a2a; - box-shadow: inset 1px 1px 3px #000; -} - -/* 12-GROUP-META */ - -dl.meta { - border-color: #555; -} - -/* 13-GROUP-BLURB */ - -li.blurb, -.listbox li.blurb { - box-shadow: 1px 1px 3px #000; -} - -.blurb .blurb { - background: #2a2a2a; - box-shadow: inset 1px 1px 3px #000; -} - -.blurb h4 a:link { - color: #95c6f4; -} - -.picture .header { - border-color: #555; -} - -.listbox li.blurb { - background: #333; -} - -.bookmark .user { - border-color: #555; -} - -.reading h4.viewed { - background: #2a2a2a; -} - -/* 15-GROUP-COMMENT */ - -div.comment, -li.comment { - border-color: #555; - box-shadow: 1px 1px 3px #000; -} - -.comment h4.byline { - background: transparent; -} - -.comment div.icon { - border-bottom-color: #555; -} - -.thread .even { - background: #2a2a2a; -} - -/* 16-ZONE-SYSTEM */ - -.splash .module h3 { - border-bottom-color: #555; - color: #95c6f4; -} - -/* module: browse */ - -.splash .browse li a:before { - color: #95c6f4; -} - -/* module: favorite tags */ - -.splash .favorite li:nth-of-type(odd) a { - background: #2a2a2a; -} - -.splash .favorite li:nth-of-type(odd) a:hover, -.splash .favorite li:nth-of-type(odd) a:focus { - background: #95c6f4; -} - -/* module: intro */ - -.splash .module div.account { - background: transparent; - border-color: #555; - box-shadow: 1px 1px 3px #000; -} - -/* module: news */ - -.splash .news li { - border-bottom-color: #2a2a2a; -} - -/* 6. ZONE: SYSTEM: FAQS */ - -.faq .categories h3 { - border-bottom-color: #eee; -} - -.faq .example, -.guideline .example { - border-color: #75bcff; -} - -/* 7. ZONE: SYSTEM: TOS, TOS FAQ, AND TOS POPUP */ - -.tos .userstuff nav.toc > details > summary { - border-bottom-color: #eee; -} - -#tos_prompt { - background: #333; -} - -#tos_prompt .heading { - background: #2a2a2a; - color: #95c6f4; -} - -#tos_prompt [disabled] { - background: #222; -} - -/* 8. ZONE: SYSTEM: PROXY NOTICE */ - -#proxy-notice { - background: #330f0f; - border-bottom-color: #ff7575; -} - -/* 18-ZONE-SEARCH-BROWSE */ - -form.search input[type="text"] { - border-top-color: #000; -} - -.search [role="tooltip"] { - background: #95c6f4; - border-color: #111; -} - -form.filters fieldset { - border: 1px solid #555; - box-shadow: 1px 1px 3px #000; -} - -.filters .expander { - color: #eee; - box-shadow: none; -} - -.filters .group dt.bookmarker { - border-top-color: #444; -} - -/* 19-ZONE-TAGS */ - -.nomination dt { - background: #333; -} - -/* 21-USERSTUFF */ - -.userstuff h2 { - color: #fff; -} - -.userstuff h3 { - border-bottom-color: #555; -} - -.userstuff blockquote { - border-left-color: #555; -} - -.userstuff table { - box-shadow: none; -} - -/* 22-SYSTEM-MESSAGES */ - -.announcement .action { - background: #333; - border-color: #222; -} - -.required { - color: #83caff; -} - -.error, -.alert.flash { - color: #eee; -} - -.notice, -.comment_notice, -.kudos_notice, -ul.notes, -.qtip-content { - background: #333; - border-color: #75bcff; - box-shadow: none; -} - -.caution { - background: #333; - border-color: #ffd875; - color: #ffe6a8; - box-shadow: none; -} - -.error, -.comment_error, -.kudos_error, -.alert.flash { - background: #333; - border-color: #ff7575; - color: #ffada8; - box-shadow: none; -} - -form .notice, -form ul.notes { - box-shadow: none; -} - -/* symbols */ - -span.symbol { - color: #95c6f4; -} - -span.question { - background: #95c6f4; - border-color: #111; - color: #111; - box-shadow: none; -} - -/* 24-ROLE-ADMIN */ - -/* Note: There is no reasonable way to change the #footer background for admins outside the default site skin, which only loads 24-role-admin.css if the user is logged in as an admin. Styles in this and other skins will be loaded for everyone. */ - -#header .admin { - background: #277e7e; - border-top-color: #333; -} - -#header .admin a:hover, -#header .admin a:focus { - color: #fff; -} - -.admin .management a { - border-bottom-color: #73c4c4; -} - -#admin_users_table th a:visited { - color: #c2c2c2; -} - -#admin_users_table th a:hover { - color: #73c4c4; -} diff --git a/public/stylesheets/masters/low_vision_default/low_vision_default_site_screen_.css b/public/stylesheets/masters/low_vision_default/low_vision_default_site_screen_.css deleted file mode 100644 index 0c4b75754e3..00000000000 --- a/public/stylesheets/masters/low_vision_default/low_vision_default_site_screen_.css +++ /dev/null @@ -1,193 +0,0 @@ -#outer * { - box-shadow: none; -} - -.icon { - background: none; -} - -#main, -#dashboard, -#dashboard ul, -#main.dashboard, -fieldset, -form dl, -fieldset dl dl, -fieldset fieldset fieldset, -fieldset fieldset dl dl, -dd.hideme, -form blockquote.userstuff { - margin: 2%; - padding: 2%; -} - -#dashboard, -#dashboard ul, -#main.dashboard, -#inbox-form, -.alphabet .listbox li, -.media .listbox, -.works-index .index, -.collections-index .index, -.bookmarks-index .index { - float: none; - width: auto; - max-width: 100%; -} - -#inner .filters, -.filters dt, -media .listbox, -.bookmark .recent .index { - width: 100%; -} - -.group .group, -.actions a, -.actions a:link, -.actions a:hover, -.actions a:focus, -.actions input, -.actions input:hover, -.actions input:focus, -.actions button, -.actions button:hover, -.actions button:focus, -.flash, -fieldset, -#header ul.primary li.search, -.listbox fieldset, -fieldset, -form dl, -fieldset dl dl, -fieldset fieldset fieldset, -fieldset fieldset dl dl, -form.single fieldset, -dd.hideme, -form blockquote.userstuff { - border: 2px solid; -} - -ul.navigation + .index { - clear: both; -} - -li.blurb, -.group { - visibility: visible; -} - -li.blurb, -.bookmark div.user { - padding: 3%; -} - -.listbox .blurb, -.group.listbox .index { - margin: auto; -} - -.group.listbox .index, -fieldset.listbox.group { - padding: 0; - border: 0; -} - -fieldset dd dl, -form .meta dd, -fieldset dl fieldset dl, -dd fieldset { - margin: 2% 0; - border: 0; -} - -.meta .stats dl dd, -.meta .stats dl dt { - display: inline-block; -} - -textarea, -pre { - font-size: 200%; -} - -#header li, -#footer li, -.home .primary .navigation a, -.blurb .blurb, -.blurb .actions a, -#header li a, -#footer li a, -#footer li button, -#header .open .menu { - display: block; -} - -#header .navigation, -#header li a, -#footer * { - float: none; -} - -#header h1 img, -#greeting p.icon, -#header .tip { - visibility: hidden; - display: none; -} - -#header .menu { - display: none; - position: static; -} - -#header, -#header .open a, -#header .primary .dropdown a:focus, -#header .user .dropdown a:focus, -#footer, -.actions a:hover, -.actions a:focus, -input[type="submit"]:hover, -input[type="submit"]:focus, -button:hover, -button:focus { - background: #900; - color: #eee; -} - -#header h1 a { - color: #fff; -} - -#header .dropdown { - background: transparent; -} - -#header .dropdown .menu a { - background: #111; - color: #fff; -} - -#header .dropdown .menu a:hover, -#header .dropdown .menu a:focus { - background: #ccc; - color: #111; -} - -#footer button { - cursor: pointer; - height: unset; - width: 100%; - white-space: normal; - box-sizing: border-box; -} - -.bookmark div.user { - box-sizing: border-box; -} - -.bookmark .recent, -.bookmark .recent .index { - border: none; -} diff --git a/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_midsize_.css b/public/stylesheets/masters/parent_only/dark_mode/dark_mode_midsize_.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_midsize_.css rename to public/stylesheets/masters/parent_only/dark_mode/dark_mode_midsize_.css diff --git a/public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_site_screen_.css b/public/stylesheets/masters/parent_only/dark_mode/dark_mode_site_screen_.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/parent_only/dark_mode_site_screen_.css rename to public/stylesheets/masters/parent_only/dark_mode/dark_mode_site_screen_.css diff --git a/public/stylesheets/masters/snow/README.md b/public/stylesheets/masters/parent_only/snow/README.md similarity index 100% rename from public/stylesheets/masters/snow/README.md rename to public/stylesheets/masters/parent_only/snow/README.md diff --git a/public/stylesheets/site/user_skins_to_load/parent_only/snow_site_screen_.css b/public/stylesheets/masters/parent_only/snow/snow_site_screen_.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/parent_only/snow_site_screen_.css rename to public/stylesheets/masters/parent_only/snow/snow_site_screen_.css diff --git a/public/stylesheets/site/user_skins_to_load/previews/default_preview.png b/public/stylesheets/masters/previews/default_preview.png similarity index 100% rename from public/stylesheets/site/user_skins_to_load/previews/default_preview.png rename to public/stylesheets/masters/previews/default_preview.png diff --git a/public/stylesheets/masters/reversi/reversi_site_screen_.css b/public/stylesheets/masters/reversi/reversi_site_screen_.css deleted file mode 100644 index 0f1abecd46f..00000000000 --- a/public/stylesheets/masters/reversi/reversi_site_screen_.css +++ /dev/null @@ -1,383 +0,0 @@ -#outer .region, -#footer .group, -.post fieldset fieldset, -fieldset fieldset { - background: none; -} - -body, -.group, -.group .group, -.region, -.flash, -fieldset, -fieldset fieldset ul, -form dl, -textarea, -#main .verbose legend, -.verbose fieldset, -.notice, -ul.notes, -input, -textarea, -table, -th, -td:hover, -tr:hover, -.symbol .question:hover, -#modal, -.ui-sortable li, -.required .autocomplete, -.autocomplete .notice, -.system .intro, -.comment_error, -.kudos_error, -div.dynamic, -.dynamic form, -#ui-datepicker-div, -.ui-datepicker table { - background: #333; - color: #eee; - border-color: #222; - outline: #111; - box-shadow: none; -} - -#header .actions a:hover, -#header .actions a:focus, -#header .dropdown:hover a, -#header .open a, -#header .menu, -#small_login, -.group.listbox, -fieldset fieldset.listbox, -form blockquote.userstuff, -input:focus, -textarea:focus, -li.relationships a, -.group.listbox .index, -.dashboard fieldset fieldset.listbox .index, -#dashboard a:hover, -th, -#dashboard .secondary, -.secondary, -.thread .even, -.system .tweet_list li, -.ui-datepicker tr:hover { - background: #2a2a2a; -} - -#header .dropdown .menu a:hover, -#header .dropdown .menu a:focus, -.splash .favorite li:nth-of-type(odd) a, -.ui-datepicker td:hover, -#tos_prompt .heading, -#tos_prompt [disabled] { - background: #111; -} - -#outer, -.javascript, -.statistics .index li:nth-of-type(even), -#tos_prompt, -.nomination dt { - background: #333; -} - -#header ul.primary, -#outer #footer, -.toggled form { - background: url("/images/skins/textures/tiles/black-noise.jpg"); -} - -#header ul.primary, -#footer, -#dashboard ul, -dl.meta, -.group.listbox, -fieldset fieldset.listbox, -#main li.blurb, -form blockquote.userstuff, -div.comment, -li.comment, -.toggled form, -form dl dt, -form.single fieldset, -#inner .module .heading, -.bookmark .status span, -.splash .news li, -.filters .group dt.bookmarker { - border-color: #555; -} - -.group.listbox, -fieldset fieldset.listbox, -#main li.blurb, -.wrapper, -#dashboard .secondary, -.secondary, -form blockquote.userstuff, -.thread .comment, -.toggled form { - box-shadow: 1px 1px 3px #000; -} - -#dashboard .current, -.actions a:active, -#outer .current, -a.current, -.current a:visited, -span.unread, -.replied, -span.claimed, -dl.index dd, -.own, -.draft, -.draft .unread, -.child, -.unwrangled, -.unreviewed, -.ui-sortable li:hover { - background: #000; - border-color: #555; - box-shadow: -1px -1px 3px #000; -} - -input, -textarea { - box-shadow: inset 0 1px 2px #000; -} - -li.blurb, -.blurb .blurb, -.listbox .index, -fieldset fieldset.listbox, -.dashboard .listbox .index { - box-shadow: inset 1px 1px 3px #000; -} - -#footer a:hover, -#footer a:focus, -#footer button:hover, -#footer button:focus, -.autocomplete .dropdown ul li:hover, -.autocomplete .dropdown li.selected, -a.tag:hover, -.listbox .heading a.tag:visited:hover, -.symbol .question, -.qtip-content { - background: #5998D6; - color: #111; -} - -.splash .favorite li:nth-of-type(odd) a:hover, -.splash .favorite li:nth-of-type(odd) a:focus { - background: #5998D6; - color: #111; -} - -#header #greeting img, -#header .heading a, -#header .heading a:visited, -#header .user a:hover, -#header .user a:focus, -#header fieldset, -#header form, -#header p, -#dashboard a:hover, -.actions a:hover, -.actions button:hover, -.actions input:hover, -.delete a, -span.delete, -span.unread, -.replied, -span.claimed, -.draggable, -.droppable, -span.requested, -a.work, -.blurb h4 a:link, -.blurb h4 img, -.splash .module h3, -.splash .browse li a:before, -.required, -.error, -.comment_error, -.kudos_error, -a.cloud7, -a.cloud8, -#tos_prompt .heading { - color: #5998D6; -} - -#greeting .icon, -#dashboard, -#dashboard.own, -.error, -.comment_error, -.kudos_error, -.LV_invalid, -.LV_invalid_field, -input.LV_invalid_field:hover, -input.LV_invalid_field:active, -textarea.LV_invalid_field:hover, -textarea.LV_invalid_field:active, -.qtip-content { - border-color: #5998D6; -} - -a, -a:link, -a.tag, -#header a, -#header a:visited, -#header .primary .open a, -#header .primary .dropdown:hover a, -#header .primary .dropdown a:focus, -#header #search input:focus, -#header #search input:hover, -#dashboard a, -#dashboard span, -#dashboard .current, -.heading, -.group .heading, -.filters dt a:hover { - color: #fff; -} - -a:visited, -.actions a:visited, -.action a:link, -.action a:visited, -.listbox .heading a:visited, -span.series .divider { - color: #999; -} - -.actions a, -.actions a:link, -.action, -.action:link, -.actions button, -.actions input, -input[type="submit"], -button, -.current, -.actions label, -#header .actions a { - background: #555; - border-color: #222; - color: #eee; - box-shadow: inset 0 -8px 4px #232323, inset 0 8px 7px #555; - text-shadow: none; -} - -.actions a:hover, -.actions button:hover, -.actions input:hover, -#dashboard a:hover, -label.action:hover, -.action:hover, -.actions a:focus, -.actions button:focus, -.actions input:focus, -#dashboard a:focus, -.actions .disabled select { - color: #999; - border-color: #000; - box-shadow: inset 2px 2px 2px #000; -} - -.actions a:active, -.current, -a.current, -.current a:visited { - color: #fff; - background: #555; - border-color: #fff; - box-shadow: inset 1px 1px 3px #333; -} - -.delete a, -span.delete { - box-shadow: -1px -1px 2px rgba(255,255,255.25); -} - -.actions label.disabled { - background: #222; - box-shadow: none; - } - -ul.required-tags, -.bookmark .status span, -.blurb .icon { - opacity: 0.9; - border: 0; -} - -#outer .group .heading, -#header .actions a, -fieldset.listbox .heading, -.userstuff .heading, -.heading, -.userstuff h2 { - text-shadow: none; - color: #fff; - background: none; -} - -#header .actions a, -fieldset fieldset, -.mce-container button, -.filters .expander, -.actions .disabled select { - box-shadow: none; -} - -fieldset fieldset.listbox { - outline: none; -} - -form dd.required { - color: #eee; -} - -.mce-container input:focus { - background: #F3EFEC; -} - -.announcement .userstuff a, -.announcement .userstuff a:link, -.announcement .userstuff a:visited:hover { - color: #111; -} - -.announcement .userstuff a:visited { - color: #666; -} - -.announcement .userstuff a:hover, -.announcement .userstuff a:focus { - color: #999; -} - -.event.announcement .userstuff a, -.filters .expander { - color: #eee; -} - -.announcement .action { - background: #333; -} - -.announcement .action:hover, -.announcement .action:focus { - color: #fff; - box-shadow: inset 2px 2px 2px #000; -} - -.caution { - border-color: #807640; - color: #dbbc54; -} diff --git a/public/stylesheets/masters/snow/snow_site_screen_.css b/public/stylesheets/masters/snow/snow_site_screen_.css deleted file mode 100644 index a882671771b..00000000000 --- a/public/stylesheets/masters/snow/snow_site_screen_.css +++ /dev/null @@ -1,56 +0,0 @@ -body, -th, -tr:hover, -col.name, -fieldset fieldset, -fieldset dl dl, -form blockquote.userstuff, -button:focus, -input:focus, -select:focus, -textarea:focus, -.autocomplete div.dropdown ul, -#ui-datepicker-div, -#ibox_wrapper, -#ibox_content, -.toggled form, -.dynamic form, -.secondary, -.listbox .index, -.dashboard .listbox .index, -.nomination dt { - background: #fff; -} - -#header h2, -#footer ul, -#footer ul.navigation a, -.autocomplete .dropdown ul li:hover, -.autocomplete .dropdown li.selected, -a.tag:hover { - color: #fff; -} - -tbody tr, -thead td, -#header #small_login, -fieldset, -form dl, -fieldset dl dl, -fieldset fieldset fieldset, -fieldset fieldset dl dl, -dd.hideme, -form blockquote.userstuff, -form dt, -.actions a:active, -.current, -a.current, -.current a:visited, -.search span.tip { - border-color: #fff; -} - -form .notice, -form ul.notes { - box-shadow: 0px 0 3px #fff; -} diff --git a/public/stylesheets/masters/snow_blue/snow_blue_site_screen_.css b/public/stylesheets/masters/snow_blue/snow_blue_site_screen_.css deleted file mode 100644 index 04acfac6607..00000000000 --- a/public/stylesheets/masters/snow_blue/snow_blue_site_screen_.css +++ /dev/null @@ -1,65 +0,0 @@ -#header ul.primary, -#footer, -.autocomplete .dropdown ul li:hover, -.autocomplete .dropdown li.selected, -a.tag:hover { - background: #4295BC; -} - -#header .heading a, -#header .actions a:hover, -#header .actions a:focus, -#header .dropdown:hover a, -#header .open a, -#header fieldset, -#header form, -#header p, -#dashboard a:hover, -.actions a:hover, -.actions button:hover, -.actions input:hover, -label.action:hover, -.action:hover, -.delete a, -span.delete, -span.unread, -.replied, -span.claimed, -.draggable, -.droppable, -span.requested, -a.work, -.blurb h4 a:link, -.blurb h4 img, -.system .latest h3, -.system div.news h3, -.system .social h3, -.required, -.error, -a.cloud7, -a.cloud8 { - color: #347391; -} - -#dashboard, -#dashboard.own, -.error, -.comment_error, -.kudos_error, -#header ul.primary, -.LV_invalid, -.LV_invalid_field, -input.LV_invalid_field:hover, -input.LV_invalid_field:active, -textarea.LV_invalid_field:hover, -textarea.LV_invalid_field:active, -#header .primary a, -#header .primary input, -#header .search input { - border-color: #347391 !important; -} - -#header .menu a, -#header .dropdown:hover .menu a { - color: #111; -} diff --git a/public/stylesheets/masters/dark_mode/README.md b/public/stylesheets/masters/top_level/dark_mode/README.md similarity index 100% rename from public/stylesheets/masters/dark_mode/README.md rename to public/stylesheets/masters/top_level/dark_mode/README.md diff --git a/public/stylesheets/site/user_skins_to_load/dark_mode.css b/public/stylesheets/masters/top_level/dark_mode/dark_mode.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/dark_mode.css rename to public/stylesheets/masters/top_level/dark_mode/dark_mode.css diff --git a/public/stylesheets/masters/low_vision_default/README.md b/public/stylesheets/masters/top_level/low_vision_default/README.md similarity index 100% rename from public/stylesheets/masters/low_vision_default/README.md rename to public/stylesheets/masters/top_level/low_vision_default/README.md diff --git a/public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css b/public/stylesheets/masters/top_level/low_vision_default/low_vision_default_site_screen_.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/low_vision_default_site_screen_.css rename to public/stylesheets/masters/top_level/low_vision_default/low_vision_default_site_screen_.css diff --git a/public/stylesheets/masters/reversi/README.md b/public/stylesheets/masters/top_level/reversi/README.md similarity index 100% rename from public/stylesheets/masters/reversi/README.md rename to public/stylesheets/masters/top_level/reversi/README.md diff --git a/public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css b/public/stylesheets/masters/top_level/reversi/reversi_site_screen_.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/reversi_site_screen_.css rename to public/stylesheets/masters/top_level/reversi/reversi_site_screen_.css diff --git a/public/stylesheets/masters/snow_blue/README.md b/public/stylesheets/masters/top_level/snow_blue/README.md similarity index 100% rename from public/stylesheets/masters/snow_blue/README.md rename to public/stylesheets/masters/top_level/snow_blue/README.md diff --git a/public/stylesheets/site/user_skins_to_load/snow_blue_site_screen_.css b/public/stylesheets/masters/top_level/snow_blue/snow_blue_site_screen_.css similarity index 100% rename from public/stylesheets/site/user_skins_to_load/snow_blue_site_screen_.css rename to public/stylesheets/masters/top_level/snow_blue/snow_blue_site_screen_.css From f9aaf9722e22379d749b74bfbcabb55ea781ea35 Mon Sep 17 00:00:00 2001 From: weeklies <80141759+weeklies@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:21:24 +0000 Subject: [PATCH 6/7] Tidy names --- lib/tasks/skin_tasks.rake | 20 +++++++++---------- public/stylesheets/README.md | 2 -- .../user_skins_to_load => masters}/README.md | 6 +++--- .../masters/parent_only/dark_mode/README.md | 1 + script/reset_database.sh | 2 +- spec/lib/tasks/skin_tasks.rake_spec.rb | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) rename public/stylesheets/{site/user_skins_to_load => masters}/README.md (88%) create mode 100644 public/stylesheets/masters/parent_only/dark_mode/README.md diff --git a/lib/tasks/skin_tasks.rake b/lib/tasks/skin_tasks.rake index f52c7d41185..01ff94b65f4 100644 --- a/lib/tasks/skin_tasks.rake +++ b/lib/tasks/skin_tasks.rake @@ -63,9 +63,9 @@ namespace :skins do end end - def load_parent_user_skins(replace:) + def load_parent_only_skins(replace:) parent_only_skins.each do |skin_file| - load_user_css( + load_official_css( filename: skin_file, replace: replace, parent_only: true @@ -73,8 +73,8 @@ namespace :skins do end end - desc "Purge user skins parents" - task(purge_user_skins_parents: :environment) do + desc "Purge parents of official skins" + task(purge_official_skin_parents: :environment) do top_level_skins.each do |skin_file| skin_content = File.read(skin_file) @@ -88,15 +88,15 @@ namespace :skins do end end - desc "Load user skins" - task(load_user_skins: :environment) do + desc "Load official skins" + task(load_official_skins: :environment) do replace = ask("Replace existing skins with same titles? (y/n) ") == "y" - Rake::Task["skins:purge_user_skins_parents"].invoke if replace - load_parent_user_skins(replace: replace) + Rake::Task["skins:purge_official_skin_parents"].invoke if replace + load_parent_only_skins(replace: replace) top_level_skins.each do |skin_file| - load_user_css( + load_official_css( filename: skin_file, replace: replace, preview_path: File.join(File.dirname(skin_file), "preview.png") @@ -107,7 +107,7 @@ namespace :skins do WorkSkin.basic_formatting end - def load_user_css(filename:, replace: false, parent_only: false, preview_path: default_skin_preview_path) + def load_official_css(filename:, replace: false, parent_only: false, preview_path: default_skin_preview_path) skin_content = File.read(filename) return if skin_content.blank? diff --git a/public/stylesheets/README.md b/public/stylesheets/README.md index 8ce9fcfc080..05328da9cdd 100644 --- a/public/stylesheets/README.md +++ b/public/stylesheets/README.md @@ -21,5 +21,3 @@ process as all other code changes. Remember, though: changes to a skin's files in the masters directory will not affect the skin on production! An admin will still need to edit the skin via the admin interface and paste in the updated master version. - -**Note**: To keep development data in sync with the master copies, please ensure any skin changes are mirrored in `site/user_skins_to_load`. diff --git a/public/stylesheets/site/user_skins_to_load/README.md b/public/stylesheets/masters/README.md similarity index 88% rename from public/stylesheets/site/user_skins_to_load/README.md rename to public/stylesheets/masters/README.md index 6af80d9b65b..15ea62a2dce 100644 --- a/public/stylesheets/site/user_skins_to_load/README.md +++ b/public/stylesheets/masters/README.md @@ -1,15 +1,15 @@ # Guide This folder contains CSS files for user skins that are loaded into the development database using the provided rake tasks. The skins can be organized into two categories: -- **Top-Level Skins**: Skins that are added to the skin chooser and subsequently cached. +- **Top-Level Skins**: Located in the `top_level/` subdirectory. Skins that are added to the skin chooser and subsequently cached. - Preview images for skins should be placed in the `previews/` subdirectory. If no preview is provided, the default preview image will be used. -- **Parent-Only Skins**: Located in the `parent_only/` subdirectory, skins that are used as parent components for top-level skins. +- **Parent-Only Skins**: Located in the `parent_only/` subdirectory. Skins that are used as parent components for top-level skins. ## Rake tasks ### Load user skins ```bash -rake skins:load_user_skins +rake skins:load_official_skins ``` This task will: - Prompt you whether to replace existing skins (`y/n`). diff --git a/public/stylesheets/masters/parent_only/dark_mode/README.md b/public/stylesheets/masters/parent_only/dark_mode/README.md new file mode 100644 index 00000000000..6ccc54568b9 --- /dev/null +++ b/public/stylesheets/masters/parent_only/dark_mode/README.md @@ -0,0 +1 @@ +This directory contains the parents of the Dark Mode skin. Please refer to [`public/stylesheets/masters/top_level/dark_mode/README.md`](https://github.com/otwcode/otwarchive/tree/master/public/stylesheets/masters/top_level/dark_mode/README.md) for a full overview. diff --git a/script/reset_database.sh b/script/reset_database.sh index 30a62f009f5..2bc666563d8 100755 --- a/script/reset_database.sh +++ b/script/reset_database.sh @@ -11,7 +11,7 @@ development) bundle install bundle exec rake db:otwseed bundle exec rake skins:load_site_skins - echo "n" | bundle exec rake skins:load_user_skins + echo "n" | bundle exec rake skins:load_official_skins bundle exec rake skins:cache_chooser_skins bundle exec rake search:index_tags bundle exec rake search:index_works diff --git a/spec/lib/tasks/skin_tasks.rake_spec.rb b/spec/lib/tasks/skin_tasks.rake_spec.rb index b298cf3b9f3..9c588b87906 100644 --- a/spec/lib/tasks/skin_tasks.rake_spec.rb +++ b/spec/lib/tasks/skin_tasks.rake_spec.rb @@ -34,7 +34,7 @@ end end -describe "rake skins:load_user_skins" do +describe "rake skins:load_official_skins" do before do allow($stdin).to receive(:gets).and_return("n") From 273787b92cda2757d8818af3961ff44d1801414f Mon Sep 17 00:00:00 2001 From: weeklies <80141759+weeklies@users.noreply.github.com> Date: Thu, 18 Sep 2025 21:18:48 +0000 Subject: [PATCH 7/7] Fix the test --- spec/lib/tasks/skin_tasks.rake_spec.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/spec/lib/tasks/skin_tasks.rake_spec.rb b/spec/lib/tasks/skin_tasks.rake_spec.rb index 9c588b87906..657dfdb8a42 100644 --- a/spec/lib/tasks/skin_tasks.rake_spec.rb +++ b/spec/lib/tasks/skin_tasks.rake_spec.rb @@ -37,15 +37,12 @@ describe "rake skins:load_official_skins" do before do allow($stdin).to receive(:gets).and_return("n") - - allow(Skin).to receive(:skin_dir_entries).with(user_skin_path, anything).and_return(["test_skin.css", "child_skin.css"]) - allow(File).to receive(:read).with(/.*css/).and_return( + allow(File).to receive(:read).with(/.*css/).and_return("") + allow(File).to receive(:read).with(/top_level/).and_return( "/* SKIN: Test Skin */", "/* SKIN: Child */\n/* PARENTS: Parent */" ) - - allow(Skin).to receive(:skin_dir_entries).with(parent_skin_path, anything).and_return(["parent_skin.css"]) - allow(File).to receive(:read).with(/.*parent_skin\.css/).and_return("/* SKIN: Parent */\n#unused-selector { content: none; },") + allow(File).to receive(:read).with(/parent_only/).and_return("/* SKIN: Parent */\n#unused-selector { content: none; }") end it "creates parent-only skins from the specified directory" do @@ -57,7 +54,7 @@ expect(parent_skin.in_chooser).to be false end - it "creates user skins in the specified directory and adds them to skin chooser" do + it "creates official skins in the specified directory and adds them to skin chooser" do subject.invoke skin = Skin.find_by(title: "Test Skin")